Grow your CSS skills. Land your dream job.

consistant / manage between FF and IE

  • # February 14, 2011 at 7:43 am

    Hello All, I hope you can help me:
    I’ve created a simple website working with CSS and it seems to work differently between FF and IE,
    So i remember i saw once you can control them separately by using before the CSS command * or /

    I’m trying to do a simple padding for example:


    .padding-R {
    padding-right:80px;

    }

    and i would like it to work only in IE, because in FF it’s working fine.

    # February 14, 2011 at 7:48 am

    Do you mean something like /* IE Stylesheet */ ? That is to enter a comment in CSS. For it to work only in IE, you need to use javascript and a conditional stylesheet. Not all designs and layouts will look the same in each browser. Remember that.

    # February 14, 2011 at 9:32 am

    I think he means the star html hack

    * html .padding-R { styles only IE will read }

    Note that this hack only works for IE6 and IE7 (in quirks mode). Furthermore, it’s use is discouraged now. Feeding IE only stylesheets through Conditional Comments is the current standard practice. However, don’t go feeding IE an entirely different stylesheet. Design with standards in mind, and just feed IE the fixes it requires.

    # February 14, 2011 at 10:53 am

    ohhh, i think i got it, it should be like that in IE7


    *.padding-L {
    background-color: #000000;

    }

    and for IE8 should be like that:

    *.padding-L {
    background-color: #000000/;

    }
    # February 14, 2011 at 12:22 pm

    no, that shouldn’t do anything but select any selector with the class of padding-L, which is exactly the same as just using the class selector itself (only yours carries more weight). Neither IE7 or 8 have problems with background colors. You haven’t taken our advice and fed IE through conditional comments…

    What exactly is the problem, so that we may better be able to help you?

    # February 15, 2011 at 3:48 am

    Your advice didn’t work,
    This example, i checked it and that was my sulotion,
    Also, it’s just an example to change the background,
    what i find out is that u need to add this- / before closing the css ;
    so if it was padding only for IE (and not FF for example) it was like that,

     *.padding-L {
    padding-left: 30px/;

    }

    What do you think, did i do something wrong?

    # February 15, 2011 at 3:57 am

    Btw, i really like this forum
    You answering quickly and if feels like a good community

    # February 15, 2011 at 4:01 am

    Add this to your HTML head

    # February 23, 2011 at 7:59 am

    I don’t know, i guess nothing is working for me.
    Can you please give me an example of simple html file with css include
    for making padding (for example padding-left:40px; ) and make it work in
    Internet Explorer and also Firefox?

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".