OZONE Asylum
Forums
XML - XSL - XSLT - XHTML - CSS - DOM
center a div that uses absolute positioning?
This page's ID:
22604
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
I've found this to work rather well... You just set the width of the container div, then set the position (left) to 50%. That puts the left hand edge of the div in the center. Now pull it back half of the width of the div and you're at center :) [code] #container { position: absolute; left: 50%; width: 400px; margin-left:: -200px; } [/code] [url=http://www.oldmanpants.ca] [img]http://miniportal.ca/members/pics/2_sig_mini2.gif[/img] [/url]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »