Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Basic cascade question

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #151703
    StrictlyBev
    Participant

    Hi there,

    this is a basic cascade question which has muddled me a little bit and I’m hoping that someone can throw a light on the best way to approach it. So it’s about lists…..

    I have something like this….

    <header id="main">
    
    <ul>
    <li>Item</li>
    <li>Item</li>
    </ul>
    
    <h1>I don't get it</h1>
    
    <ul>
    <li>Item</li>
    <li>Item</li>
    </ul>
    
    <div id="somethingElse">
    <ul>
    <li>Item</li>
    <li>Item</li>
    </ul>
    </div>
    
    </header>
    

    The question is this. Having applied styles to the all the

    <

    ul> in #main i.e

    main ul {some style}

    main li {some style}

    I now want to style the list in the div#somethingElse differently. But it is taking on the styling for the above even if I create new styles for that id i.e the below gets ignored.

    somethingElse ul {some style}/this gets ignored – why?/

    somethingElse li {some style}/this gets ignored – why?/

    Why is this happening exactly and what is the best way to deal with this situation?

    Hope that made sense! Thanks in advance Bev

    #151706
    Paulie_D
    Member

    http://codepen.io/Paulie-D/pen/nybAk

    It should work….

    Without seeing the actual site or a Codepen it’s hard to nail down exactly what is causing your particular problem.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.