How to Left, Right, Center Align With CSS


http://www.communitymx.com/content/article.cfm?cid=529B0

http://www.ehow.com/how_2284643_left-right-center-align-css.html

body {
width: 80%;
margin-right: auto;
margin-left: auto;
border: 1px solid black;

}

.container {
position: relative;
height: 50px;
}

.left-element {
position: absolute;
left: 0;
width: 50%;
}

.right-element {
position: absolute;
right: 0;
width: 50%;
text-align: right; /* depends on element width */
}

Download Samples

Advertisements

Author: Imran Akram

A .NET/SharePoint Consultant and a political enthusiast who believes in putting the feet of the elected and/or unelected officials to fire in order to get good governance.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s