css warnings

Discussion in 'CSS' started by sudhakararaog, Sep 26, 2009.

  1. #1
    i am using a backend server which is smarty which does not allow me to have multiple styles sheets and i have to only have 1 css file for all the html pages, also i cannot write

    <!-- IF lte IE6
    <style type="text/css">

    </style>
    end if -->

    where i can write exclusive code for ie 6 or 7 to make any adjustments to maintain browser consistancy, so i write these small ie fixes in the same style sheet i use for all the pages as


    #div{
    margin: 0 0 0 10px;
    *margin: 0 0 0 9px;
    _margin: 0 0 0 8px;

    padding: 0 0 0 10px;
    *padding: 0 0 0 8px;
    _padding: 0 0 0 9px;
    }


    when i validate my css code from css validator website i get the following warnings

    ============================================
    Parse Error *margin: 3px 0 0 0;
    Parse Error : 3px 0 0 0;
    Property _padding doesn't exist : 4px 0 0 30px
    Property _margin doesn't exist : 1px 0 0 0
    ============================================

    as i do not have an option to use another style sheet nor can i write <style></style> in my situation how can i go about writting code for ie 6 and 7 and sometimes even for firefox and at the same time not get the warnings.

    please advice.

    thanks
     
    sudhakararaog, Sep 26, 2009 IP
  2. myst_dg

    myst_dg Active Member

    Messages:
    224
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    58
    #2
    Ignore the warnings man... sometimes we don't have to be that stiff.
     
    myst_dg, Sep 26, 2009 IP
  3. appleranger

    appleranger Peon

    Messages:
    339
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    The warnings are probably glitches. They are best to be ignored.
     
    appleranger, Sep 28, 2009 IP
  4. wd_2k6

    wd_2k6 Peon

    Messages:
    1,740
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    0
    #4
    If you know what your code is doing and it isn't wrong, then you can ignore the warnings I guess, but if you really want to avoid them you can either make sure your code doesn't need the hacks in the first place, or put them in conditional comments as you suggested at the start of your post. These can go inside a single CSS file also, they don't just have to be used to link to multiple stylesheet.
     
    wd_2k6, Sep 28, 2009 IP
  5. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #5
    Pretty much if you are having to dick with elements on something like margins or padding for each browser version, you are throwing 'silver bullet' hacks at the page instead of fixing the actual layout issues, as there is NO REASON to ever need to do that... Most likely you either don't have a doctype, aren't tripping haslayout, or aren't applying a double-margin fix... as to using a conditional, if you have to use one in the markup to apply a separate CSS file, you've got deeper issues since that ****otry is never necessary.

    Do you have an actual example of where you have to apply such changes to each browser? Perhaps we can show you how to write the same thing working cross browser without that asshattery.
     
    deathshadow, Sep 28, 2009 IP