multiple combinator

Discussion in 'CSS' started by vurentjie, Aug 28, 2009.

  1. #1
    hi,
    quick question

    is it possible to have more than two combinators in a selector

    would this be possible...

    div>p+span


    ...how would this be read? a span immediate sibling of p which in turn is a direct child of div??
     
    vurentjie, Aug 28, 2009 IP
  2. unigogo

    unigogo Peon

    Messages:
    286
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I think no. But you can give a same className for P and span
     
    unigogo, Aug 28, 2009 IP
  3. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yes.

    Yes, a span who is a (later, not previous) sibling of a p who is the direct child of a div. You gots it.

    
    <div>
      <span>Not this one</span>
      <p>stuff stuff stuff</p>
      [b]<span>this span</span>[/b]
      <p>more stuff...</p>
      [b]<span>this one too actually</span>[/b]
      <h3>some header</h3>
      <span>not this span</span>
      <div>
        <span>not this one</span>
      </div>
      <p>stuff stuff stuff <span>also not this span</span></p>
    </div>
    
    Code (markup):
     
    Stomme poes, Aug 29, 2009 IP