1. Technology

Your suggestion is on its way!

An email with a link to:

http://video.about.com/webdesign/Alignm-Text-in-a-CSS-Document.htm

was emailed to:

Thanks for sharing About.com with others!

Video:How to Align Text in a CSS document

with Don Schechter

This video demonstrates how to align text in a CSS document for your websiteSee Transcript

  • All Videos
  • All Technology Videos
  • Web Design/HTML Videos

Transcript:How to Align Text in a CSS document

Today I will show you how to align text in a CSS document for your website.

Choose a CSS File

First open notepad, or if you are using a Mac open simple text. I'm going to use a previously saved CSS document. The paragraph tag is the first place to organize the content your web page. Paragraphs are set by default to align on the left. You can change the alignment using the text-align property. Type p, brace, enter, tab, text, dash, align, colon, right, semicolon. Don t forget to close the brace.

Save your CSS file and open your HTML file in a browser to see your changes. Everything that is within a paragraph is now aligned to the right. You can type center, which will center all the text within a paragraph tag. Or you can justify the text which will stretch the words across the paragraph block on both the left and right sides.

Align the Paragraph

I want to align just this one paragraph to the right side. To align a single paragraph, in your CSS document type p, dot, right, brace, enter, tab, text dash align, colon right semicolon. Don t forget to close the brace. Save your CSS file and open your HTML file in your text editor. Within the paragraph tag that you want to align, type class equals right in quotes. Now in my browser you will see that this paragraph is aligned on the right.
About videos are made available on an "as is" basis, subject to the User Agreement.

©2014 About.com. All rights reserved.