How to Align Content in the Center of DIV

A DIV tag is an HTML element that allows the Web developer to group content on a Web page together. Often you may find either text or images inside of a DIV tag. You are able to align the content within a DIV tag so that it is on the left ,on the right, centered or justified -- meaning that all rows of text are the same length. Aligning the content in a DIV helps Web pages look clean and polished.

Instructions

    • 1

      Open the HTML page that will include the DIV tag.

    • 2

      Click anywhere on the page between the <body> and </body> tags where you want the DIV to appear.

    • 3

      Insert this code:

      <div align="center">

      Here is your text.

      </div>

    • 4

      Replace "Here is your text" with the text you want to appear on your page.

    • 5

      Replace "center" with "left," "right," or "justify" if you desire.

Related Searches:

References

Resources

Comments

Related Ads

Featured