Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple question regarding CSS

Status
Not open for further replies.

thelordoftherings

Programmer
May 16, 2004
616
IL
Hello,

How to use CSS in order to set all the elements at the html page at the center of the page?
 
<body style="text-align: center;">

Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.
 
text-align applying to all elements will only work (incorrectly) with IE in "quirks" mode (partial or no doctype)
all other browsers (and IE in "standards" mode) will correctly apply it to text elements only.

To centre all elements in all browsers without using the deprecated <center> tags or the (again) deprecated align attribute use a FULL doctype and style="margin:auto" for each element.



Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top