Text Align

Text-align will align the text in your document.

Inherited: Yes

Possible Values:
left- aligns the text to the left. default browser: Browser Dependant.
right- aligns the text to the right.
center- centers the text.
justify - justifies the text.

For example, when you want all the text in the paragraphs of your documents to be aligned to the right, your CSS code would look like:

p {
text-align: "right";
}

There are 4 diffrent ways to align your text, right, left, center, and justified. Left is usually the default in the browser.

This can come in pretty handy, especially if you want every h1 tag on every page to be centered. Then in the external css all you have to do is:

h1{
text-align: center;
}

http://www.w3schools.com/css/pr_text_text-align.asp

Although the property name is "text-align", according to the CSS specification, it applies to inline content of a block element. This implies that you aren't just limited to aligning text - that the text-align property can be used to align any element within a block level element. This appears to be how most browsers interpret the property too.

http://www.quackit.com/css/properties/css_text-align.cfm

-Ginelle


Page Information

  • 10 months ago [history]
  • View page source
  • You're not logged in
  • No tags yet learn more

Wiki Information

Recent PBwiki Blog Posts