View Full Version : CSS Rendering in Firefox and Internet Explorer

10-14-2007, 07:36 PM
Hey guys, is it true that the output for the above will be different in both browsers?

Im trying to position a table right all the way to the top using CSS. Somehow, my desired output works in Firefox but not in Internet Explorer. The table doesnt stick all the way to the top edge in IE.

What do u tink i should do?

CSS Code:
table {
position: fixed;
top: -1px;

10-14-2007, 07:40 PM
postion:fixed is not supported by IE

Darth Oinker
10-14-2007, 10:30 PM
postion:fixed is not supported by IE

true and false

position:fixed is supported in IE7 but not in IE6 and below.

you can however overcome this lack with a few tricks:

conditional comments to include a css file strictly for IE6

the following example will include a different file for less than or equal to ie6 and then a different file if greater than ie6 (note that this code is very finiky and must be exact - the filename can be changed, the media can be changed and conditional comments do not work in the external CSS files)

<!--[if lte IE 6]>
<link rel="stylesheet" media="all" type="text/css" href="/main.ie.css" />
<!--[if gt IE 6]>
<link rel="stylesheet" media="all" type="text/css" href="/IE7.css" />

as for the fixed:position itself here are the two examples from Beginning CSS by 2nd Edition by Richard York published by WROX (I'm not the author or have any affiliation with them, the book has just really helped me out in understanding a few things about CSS)

div#fixed-top {
position: absolute;
top: expression(eval(documentElement.scrollTop) + 5);
div#fixed-bottom {
position: absolute;
bottom: auto;
top: expression(
(documentElement.scrollTop + documentElement.clientHeight - this.clientHeight) - 7