H I O X INDIA
FREE CSS Tutorial
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Templates 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)
Español Français 中文 Deutsch Portuguese Japanese தமிழ்
 Forums   Hosting   Internet Stats   Easy Calculation   FUN Games 

CSS Topics
Introduction
Types
Background Properties
Text Properties
Font Properties
BOX Properties
Border Properties
Margin Properties
Padding Properties
Special Topics
Ask Your Doubts
More about CSS
Feedback





CSS Text Alignment


Topic

How to align the text to right in html using css?
How to position the text?




Explanation


Property: Text Alignment

Usage:
text-align: center;
text-align: left;
text-align: right;
text-align: justify;

Definition:
This will align the text with in the object area.
It takes the following values.
a)center : This value aligns the text to center.
b)left : This value aligns the text to left.
c)right : This value aligns the text to right.
d)justify : This justifies the text with default value.

Example 1:
<div style="text-align: center;">testing text align</div>

Result:
testing text align

Example 2:
<div style="text-align: left;">testing text align</div>

Result:

testing text align



Example 3:
<div style="text-align: right;">testing text align</div>

Result:
testing text align



Example 4:
<div style="text-align: justify;">testing text align</div>

Result:
testing text align







A Note
CSS - Cascading Style Sheets can be used along with html tags as explained in this site. This simple CSS will help you to create much elegant and neat html web pages. This does not need any additional softwares or codings. All web browser are capable of handing CSS codes.

Note 2: If required you can using <span> instead of <div> tags. div tag will start and end on new lines. span will not exceed the tag area.


privacy policy     license     sitemap
© 2004-2010 HIOX INDIA