Forum Moderators: not2easy

Message Too Old, No Replies

should i target IE7 specifically to fix probs?

         

Geoffrey james

7:45 pm on Nov 6, 2006 (gmt 0)

10+ Year Member



Hi all,

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

DanA

7:58 pm on Nov 6, 2006 (gmt 0)

10+ Year Member



How do you target IE 5 and 6?
Do you use conditional comments?
Do you use Quirks Mode?
In Standards Compliance Mode, IE 7 should not need IE 6 fixes, what happens if you serve the same css to IE 7 and Firefox?
If you have to target IE 7 only, one of the solutions can be conditional comments.

Geoffrey james

8:46 pm on Nov 6, 2006 (gmt 0)

10+ Year Member



Hi DanA

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

DanA

8:58 pm on Nov 6, 2006 (gmt 0)

10+ Year Member



Try to replace <!--[if IE]> by <!--[if lt IE 7]> to see what happens.
Do you use a full doctype?

Geoffrey james

9:10 pm on Nov 6, 2006 (gmt 0)

10+ Year Member



i did...well sort of, but it only took notice of the [if IE]

Geoffrey james

9:12 pm on Nov 6, 2006 (gmt 0)

10+ Year Member



i use full 1.0 xhtml transitional...should i use another, maybe strict, i dont know

DanA

9:21 pm on Nov 6, 2006 (gmt 0)

10+ Year Member



The Doctype should be fine
If changing the conditional comments did not fix the problem and if you have changed vector version in the registry use :
<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" media="screen" href="ie.css" />
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" media="screen" href="ie7.css" />
<![endif]-->