How to Center Text in HTML

Most tasks in HTML can be accomplished by placing an instruction known as a "tag" before and after the text that you want to affect, and centering text is no exception. Text marked as centered will appear halfway between the left and right margins of the display window.

Things You'll Need

  • Text file editor
Show More

Instructions

  1. Center Text in HTML

    • 1

      Open the program you're using to edit your web page, then open the page itself and position the cursor wherever you want the centered text to display.

    • 2

      Type the following:

      .

    • 3

      Type the text you want to appear centered.

    • 4

      Type the following immediately after the last character of your citation: .

    • 5

      Open up your web page in a browser such as Firefox, Internet Explorer or Netscape to check that your text appears centered.

Tips & Warnings

  • HTML is a very precise science, so you must perform the steps with complete precision. If you get no effect, or if you get a stream of code-like characters showing up in your web page, go back and make sure you have every angle bracket (< and >) placed correctly.

  • Don't forget to close your center tag, or all your subsequent text will take be centered as well.

  • Though the center tag has not been phased out, more precise formatting can be achieved if you learn how to use a tool known as CSS style sheets, with the text-align property.

Related Searches:

Resources

Comments

  • smiker08 May 23, 2009
    You can't see the CODE to be able to follow. You would need to set the code up as an image.

You May Also Like

Related Ads

Featured