Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE7 and CSS

Status
Not open for further replies.

thompom

Technical User
Dec 4, 2006
395
GB
Hi,

had my site layed out with css in IE6 and it looked fine,
i fixed any Mozilla layout issues with

Code:
html>body #layout {
...css here
}

i have just updated to IE 7 and it is all out of alignment,
it seems that IE7 uses the css that mozilla uses
so what css do i need to use to fix any IE 7 issues

thanks MG
 
ok done a bit of reading and have dropped

Code:
html>body #layout {
}

and am now using
Code:
#layout {
*padding-top: 10px (ie6 and 7);
_padding-top: 20px ((ie6 only);
}

any other tips
 
IE7 and FF (Mozilla) should render the page virtually the same, so you should have your main stylesheet for those two browsers (most others, such as Safari, Opera, etc) will render that code correctly as well. Then compose an additional stylesheet and use IE conditional comments to insert the special IE6 stylesheet. If you only need very few IE6 fixes, you might use the underscore hack like shown in your second post, but I would still recommend the first method.

___________________________________________________________
[small]Do something about world cancer today: PACT[/small]
 
thanks - apologees for not looking at FAQ
 
hi,

have put the following in the head of my page - the source look like -

Code:
<link href="css.css" type="text/css" rel="stylesheet" />
<!--[if lt IE 7]> 
<link rel="stylesheet" href="cssIE7.css" type="text/css" /> 
<![endif]-->

but any changes made in cssIE7 file are not shown in IE7

any ideas welcome

merry xmas MG
 
Your IE conditional if sentence states "If less than (lt) IE version 7". So IE7 will return false in that if and not execute the line. If you want to reference only IE7 you should do [if IE 7], or if you want all up to and including IE7 (although that would be the same as all IE) you could do [if lte IE 7] (less than or equal). Usually the conditionals reference less than IE7 because IE7 has better support for CSS with fewer errors in rendering.

___________________________________________________________
[small]Do something about world cancer today: PACT[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top