1

In the following style:

.slider div div div h2 span { color:#ae663d;}

What is the purpose of "div div div"?

1
  • [bad_joke]Maybe the original web designer had a finger stutter?[/bad_joke] (or, it could be meager's answer!) Commented Oct 30, 2010 at 4:33

1 Answer 1

3

It specifies that the rule applies to span tags, contained in h2 tags, contained in three nested divs, under a tag with class 'slider'.

Something like this, where the <span> containing "here" will be matched:

<body class="slider">

  <div>
    <div>
      <div>
        <h2>Header text <span>here</span></h2>
      </div>
    </div>
  </div>

</body>
Sign up to request clarification or add additional context in comments.

3 Comments

Cool, that was what I thought but I wasn't sure if those divs were just duplicated or if the original author meant to do that because it seems like there should be a better way to target this the span since the number of divs its nested in could change.
@Kory It's definitely not a good idea to use a complex hierarchy to select something. Chances are .slider h2 span would have been specific enough.
+1 meagar ; Also, complex hierarchies like that can be avoided by the judicious use of classes/ids on the elements, too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.