Click to See Complete Forum and Search --> : Absolute positioning


minulescu
11-12-2003, 11:05 AM
Im, trying to use position:absolute to vertically center something on my website. The problem I'm having is when the browser window is smaller than the object, the top and left sides of the object are eaten up by the margins.
How can i prevent this?
Thanks

Here's the link:
http://www27.brinkster.com/minulescu/squaretest.htm
Play with the size of ur browser and see what happens.
Ignore the add.

toicontien
11-12-2003, 11:56 AM
I haven't done much experimenting on real CSS-compliant browsers (Mozilla, Firebird, Opera) but IE works for the most part with the code I've attached.

It validates as HTML 4.01 Loose at validator.w3.org, which is important because it forces newer browsers into standards compliance mode. With the incomplete doctype like you've got, browsers work in quirks mode and support for CSS can be VERY tempermental.

In any event, check out the attached code in different browsers. You will need to do some tweaking, but it's a start.