SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot jooles's Avatar
    Join Date
    Jun 2006
    Posts
    144
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Use Different CSS?

    There is a default CSS included in all files on the server I am working on. Is there anyway to use a CSS file that is different from the other CSS file? The issue I'm running into is that the default file has some default settings that are not what I want and I can't override them with my current file. So how do I override the default CSS file? Is this even possible?

  2. #2
    SitePoint Wizard bronze trophy DaveWoods's Avatar
    Join Date
    Dec 2004
    Location
    Derbyshire - UK
    Posts
    2,651
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you specify another stylesheet after the previous one then any new styles you specify should be applied instead so I'm not sure why you can't overwrite them?

    If the default stylesheet is included after the one you are including and want to take presidence then you can use the !important tag to overwrite styles that come afterwards .

    This could be achieved like this

    Code:
    td {
        color: #000000 !important;
        font-weight: normal !important;
    }
    But obviously if you've got a lot of styles this could get a bit messy.

    Do you have an example online of this or could you post the code of what you're trying to achieve so that I can have a better look at the problem?

  3. #3
    SitePoint Zealot jooles's Avatar
    Join Date
    Jun 2006
    Posts
    144
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cool, I have never heard of the !important tag before, but now everything works!!!
    yay thanks so much

  4. #4
    SitePoint Zealot jooles's Avatar
    Join Date
    Jun 2006
    Posts
    144
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, so everything is not perfect. IE does not recognize !important, and IE is the primary browser I am catering to (unfortunately).

    Is there an IE equivalent to !important?

  5. #5
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,288
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    IE does not recognize !important
    Yes it does

    IE does have a bug width !important where the same property is applied within the same style block but this should never happen unless you are using it as a hack.

    In the normal course of things !important should work as expected.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •