eHow launches Android app: Get the best of eHow on the go.

How To

How to Center Text in HTML

Contributor
By eHow Contributing Writer
(15 Ratings)

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.

Difficulty: Moderately Easy
Instructions

Things You'll Need:

  • Text file editor

    Center Text in HTML

  1. Step 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. Step 2

    Type the following:

    .

  3. Step 3

    Type the text you want to appear centered.

  4. Step 4

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

  5. Step 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.

Comments  

smiker08 said

Flag This Comment

on 5/23/2009 You can't see the CODE to be able to follow. You would need to set the code up as an image.

Subscribe

Post a Comment

Post a Comment

Related Ads

  • Have you done this? Click here to let us know.
I Did This
Tags
Get Free Internet Newsletters

Copyright © 1999-2009 eHow, Inc. Use of this web site constitutes acceptance of the eHow Terms of Use and Privacy Policy .   en-US Portions of this page are modifications based on work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License. † requires javascript

Demand Media
eHow_eHow Technology and Electronics