Forum Moderators: not2easy
Using floating divs through pure css.
Have got site how i want in Mozilla, Netscape, Opera using a main external css called: main.css
to help sort poitions in IE5/6 i have a seperate style sheet called: ie.css
problem is that IE7 renders them different again...I need to move the left margins of the divs within the main page by about 15px to the right.
How do I target IE7 specifically. Can I use a link to it specifically and adjust in its own external css, or can i target it from the ie.css i already have.
thanks for any help....Geoff
To render pages properly in IE i use a second external style sheet an example is below:
this is pasted between the <head></head>
<!--[if IE]><link rel="stylesheet" type="text/css" media="screen" href="ie.css" /><![endif]-->
then when positioning divs, IE displays differently than others so i use the ie style sheet to fix.
example:
/* main css style sheet */
div#content {
float: left;
margin-left: 1em;
blar blar blar
}
IE will position it too far over to the left.
so another sheet to ONLY target the margin position is used.
/* IE only style sheet */
div#content {
margin-left: 1.2em;
}
I think there are easyier ways of doing this, but at the mo I know this way and so have decided to use it.
If anyone else wants to reply to fix probs like this please tell me as im pretty new to css myself.
ps...yes i am using this peice of code at the start of my main style sheet:
*{margin:0px; padding:0px;}
Geoff