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
Some browser don't like the negative margin though and it looks like an ugly hack... and how about scaling? My solution would be: [code] .center{ position: absolute; left: 33%; right: 33%; min-width: 32%; //to keep the container open when there is no (or not enough) content. } [/code] Both left and right can adjusted at will. If the center element is the biggest you could set the left and right to 25% then the center will use half the screen. I guess this should also work with tables or p elements but i need to do some experimenting with it. Maybe your solutions is better in the real world i don't know. ------------------------------ Support [url=http://www.justice4pat.com/]Justice for Pat Richard[/url]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »