Feed Sign in with OpenID OpenID

Simon Willison’s Weblog

position:fixed in IE, no Javascript required

Via Craig Saila, a method for getting IE to apply position: fixed without resorting to Javascript. It uses a conditional comment (slightly ugly but perfectly valid HTML) and works a treat. Kudos to Eric Bednarz for clearing up another of those niggling CSS problems.

This is position:fixed in IE, no Javascript required by Simon Willison, posted on 25th April 2003.

View blog reactions

Next: Phoenix / Firebird nightlies hotting up

Previous: Experimental feature: Related entries

5 comments

  1. There's only one problem to this approach: when the page loads, the scrolling area isn't focused. This can be annoying for people who use keyboard nav, I'm not sure if it mucks up screen-readers though.

    And I don't like to blow my own trumpet (never!), but... *ahem*

    Tom Gilder - 26th April 2003 02:00 - #

  2. I've had this page up that does exactly the same thing for some time. It looks like Eric does a better job of it, though.

    Simon Jessey - 26th April 2003 03:09 - #

  3. ahem, Tom. Your example has one side effect: it displays as a beautifull blank page in Internet Explorer 5.x Mac. Blank as in empty. Only the background color comes through, nothng else. Hence the use of cc's in Erics page.

    Philippe - 26th April 2003 14:42 - #

  4. Now if someone could just find a good way to fix an element to the bottom of the page...

    kent - 1st May 2003 22:12 - #

  5. bottom: 0;

    matt - 10th September 2004 14:32 - #

Comments are closed.

Previously hosted at http://simon.incutio.com/archive/2003/04/25/positionFixedFixed

A django site