How to Set Justified Alignment

Hypertext Markup Language, or HTML, gives you the ability to define the structure and content of Web pages. It also allows you to apply a wide range of styles, including tables, lists, headings and different colors and type faces. Used on its own, however, HTML only allows you to align text in one of three ways: to the left, center or right. Fortunately, you can work around this limitation by applying a single cascading style sheet, or CSS, rule. Once you understand the proper syntax, setting your Web page text alignment as justified becomes a quick task.

Instructions

    • 1

      Open the folder containing the Web page file you want to edit.

    • 2

      Right-click the file, select "Open With" and then choose either the "WordPad" or "Notepad" option. The HTML code that comprises the page appears on your screen in the selected program within a few seconds.

    • 3

      Scroll through the lines of code until you reach the block of text that you want to apply justified alignment to. The text will be preceded by an opening paragraph (<p>) tag.

    • 4

      Add a style declaration to the opening paragraph tag so that it resembles the following:

      <p style="text-align: justify">

    • 5

      Click "File" in the top menu bar and select "Save" to confirm the change. The next time you open the page in a Web browser, the selected block of text will appear with justified alignment.

Tips & Warnings

  • If you want to set justified alignment for every paragraph in your document, you can specify a single CSS rule that applies to the entire page. To do so, locate the </head> tag located near the top of your page's HTML code (not to be confused with the similar <head> tag), click once at the start of the tag and then press the "Enter" key to create a new, blank line. Copy and paste the following code onto the blank line:

  • <style type="text/css">

  • <!--

  • p { text-align: justify }

  • -->

  • </style>

Related Searches:

References

Comments

You May Also Like

Related Ads

Featured