PDA

View Full Version : is it possible to diiferent styles for IE and FF



o0O0o.o0O0o
Aug 19th, 2009, 08:10 AM
In my wepage one image is showing correctly in FF but in IE it is some margin off.

is there any way i can include in html file that or css style sheet that


If IE
margin:5px;



IF FF;
margin:2px

abduraooft
Aug 19th, 2009, 09:21 AM
[some-selector]{
margin:2px !important;
margin:5px;
}

Check http://webdesign.about.com/od/css/f/blcssfaqimportn.htm

o0O0o.o0O0o
Aug 19th, 2009, 09:24 AM
It means IE ignores
important


I tried in IE 7 but didn't worked

_Aerospace_Eng_
Aug 19th, 2009, 09:46 AM
Is the image floated at all?

jamesschmidth
Aug 19th, 2009, 11:02 AM
i didn't know it ... its really helpful...thanks!

o0O0o.o0O0o
Aug 20th, 2009, 01:20 AM
The image is floated

_Aerospace_Eng_
Aug 20th, 2009, 03:05 AM
Add display:inline; to the css for the image. You seem to be experiencing the IE double margin bug which occurs when there is a margin set on the element in the same direction as the float. IE will double the margin. The fix is to make it display:inline but according to the specs a floated element can't be display:inline; so it still looks the same in other browsers and now it will look fine in IE. No need for conditional comments which is what you may have been asking to begin with.

aejacks8
Aug 20th, 2009, 03:19 AM
http://www.quirksmode.org/css/condcom.html

This is a good guide that helped me a lot on conditional css. Use the <!-- --> HTML Comment structure to put it inside the html files.

o0O0o.o0O0o
Aug 20th, 2009, 03:36 AM
That display inline is not working.

but this works fine


<!--[if IE]>
<style>
#call_image {

margin-top:-40px;
}

</style>
<![endif]-->


Initially evrything worked fine in ff3 and IE7 but when i upgraded to FF3.5 then there were few alignment issues.
There is difference of 30px (float right)in images in FF3.5 and IE