How to make CSS attributes override another

Discussion in 'CSS' started by Jordan Garn, Jan 7, 2009.

  1. #1
    I have an interesting problem,

    I have a plugin to a CMS that I use which when it displays it adds it's own style e.g.

    <div id="id" style="width: 100px; height: 200px;">item elements</div>

    now I need to change the width and the height but when I change the attributes in the stylesheet.

    eg

    #id{
    width: 200px;
    height: 300px;
    }

    It is over-ridden by the Style of the element in the main HTML page,

    How do I make the Stylesheets CSS declarations the ones that take effect?
     
    Jordan Garn, Jan 7, 2009 IP
  2. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #2
    I am about 99% sure that the on the page will always over ride the style sheet declarations.

    So changing it on the page is about your only choice.
     
    Colbyt, Jan 7, 2009 IP
  3. LindseyInteractive

    LindseyInteractive Well-Known Member

    Messages:
    2,830
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    175
    #3
    That's correct. When you are using on site css as well as external CSS, the on page one will ALWAYS over right the other one. That is the reason the IE hacks work the way they do.

    If you need something changed you are going to either take it out of the page it self so it follows the external file or change it in the file it self.
     
    LindseyInteractive, Jan 7, 2009 IP
  4. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #4
    So, 30 minutes after I answer that here, you repost on another forum? How many people's time do you plan to waste trying to help you?

    gary
     
    kk5st, Jan 7, 2009 IP