Martin Hollingworth

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromMartin Hollingworth
ToMe
Subjectposition:fixed workaround
Date24 January 2008 18:52
Hi Mark

Thanks for a really useful site.

I read and tried your solution to position:fixed in IE6 and Linus's
solution to the jumpyness. I found why his solution doesn't work on your
page. 

The HTML background-color was causing the problem. The only way I could
resolve it was to use

html {
            font-family: sans-serif;
            color: rgb(56,56,56);
            margin: 0;
            padding: 12px 30px;
            background-attachment : fixed;
            background-image : url(230.gif);
}

where 230.gif is a plain image in your choice of colour.

Note the background-attachment needs to be fixed otherwise it starts
jumping again.

Not the best solution perhaps, but I find most of my visitors still use
IE6.

Martin Hollingworth
FromMe
ToMartin Hollingworth
SubjectRe: position:fixed workaround
Date26 January 2008 21:27
Martin,

> The HTML background-color was causing the problem.

Yes. This is probably because it causes IE to render the BODY and HTML
backgrounds separately, instead of having the normal magical BODY. This
would also mean that position:fixed will no longer work on the BODY, and
only works on the HTML element. That's another thing that IE 6 doesn't
implement properly.


Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.