Some properties of an imported css file doesn't work

Discussion in 'CSS' started by Amr The Egyptian, Aug 22, 2011.

  1. #1
    Hi,

    My problem is that some properties like border & background-image doesn't work if the are in an imported style sheet but they work if they are inside style selector.

    Thank you!
     
    Amr The Egyptian, Aug 22, 2011 IP
  2. ptnor

    ptnor Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    online demo?
     
    ptnor, Aug 22, 2011 IP
  3. Snapins

    Snapins Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Show me online or screen..

    Sorry for my bad English.
     
    Snapins, Aug 22, 2011 IP
  4. against

    against Peon

    Messages:
    36
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    This is probably because imported styles have a lower proirity and they get overridden by something else.
    Try putting !important at the end like that:
    border: 1px solid #000 !important;
     
    against, Aug 22, 2011 IP
  5. ethikz

    ethikz Peon

    Messages:
    92
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I wouldn't use !important. It is bad CSS practice. !important was initially used to help people with visual impairments overwrite the stylesheets. Some people using visual impairment software may not be able to see your website properly if you use !important.

    To prevent the issues just try using more specific rules for the element you don't want to be overridden.

    Try reading more about specificity at Sitepoint

    But that is just my 2 cents
     
    ethikz, Aug 28, 2011 IP
  6. Rimona

    Rimona Active Member

    Messages:
    123
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    63
    #6
    Without seeing the actual code/page, all replies are wild guesses.
    Please post link to problem.
     
    Rimona, Sep 2, 2011 IP