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

How to Center Text in HTML

Video Preview

Summary: There are two ways to center text in HTML on a Web page, using an align attribute inside an existing tag or using a center tag. Center text in HTML when creating a Web site with tips from a software developer in this free video on Web design and the Internet.

Views:
762
Presenter
By Luis Estrada
eHow Presenter

Luis Estrada has a Bachelor's degree in Computer Science. He specializes in developing web sites and web applications. Estrada has been designing and creating websites for more than 8...read more

Post a Comment

Post a Comment

Video Transcript

"Hello, my name is Luis Estrada, and I am a software developer. In this video, I will show you how to center text in HTML. The first thing that we need is a basic HTML file, that has a head and body tags. Also, we need some text to format inside the body. In this video, we introduce a new HTML tag, the paragraph tag. Just type an opening p tag, and a closing p tag. Then, add some text in between them. Create another opening and closing paragraph tag, and add text for a second paragraph. Now, let's go to our browser and refresh it. This tag will make a double line break, so you have a very defined space between your paragraphs. Basically, there are two ways to center this text. You can use the align attribute inside an existing tag, or we could use the center tag. If we use the align, we are getting additional attributes to our paragraph tag. When we add a new attribute to our tag, we need to specify the value that the parameter will hold. In this case, the alignment can be either left, right, or center. For this case, right align equals center, and wrap the center word with double quotes. Now, refresh the browser again, and you see that the first paragraph is centered, while the second one is not. The align attribute can be used inside many HTML tags, such as the body tag, that would make all of the text in the web page centered. It can also be used inside tables, or columns, where this becomes very useful. I'm Luis Estrada, and I've just shown you, how to create web pages, using HTML."

eHow Article: How to Center Text in HTML

Related Ads

  • Have you done this? Click here to let us know.
Internet
Virginia DeBolt,

Meet Virginia DeBolt eHow's Internet Expert.

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.

Demand Media
eHow_eHow Technology and Electronics