li" make it faster than "ul li"? using ">" and not "" to make rendering faster, as I heard from several people? .slide:ho...">

CSS: does this "ul> li" make it faster than "ul li"?

using ">" and not "" to make rendering faster, as I heard from several people?

.slide:hover > div > span {
  border-color: #c8c8c8;
}

OR

.slide:hover div span {
  border-color: #c8c8c8;
}

Thank you so much!


update: question

any reliability issue for any of this?

+5
source share
3 answers

You must very seriously review the rumor to the people who tell you this.

At best, the difference is very small. No one should waste time, energy or brain, given such things. This is not a very useful optimization. Do not fall into the trap of premature optimization, especially for a dynamic language such as HTML / CSS.

, , , - .
ul > li , ul li, . , . .

+9

.slide:hover > div > span , .slide:hover div span.

.

/ , (. @Boris Zbarsky). .

Child Selector - IE6 .

99% IE6 , :

http://ie6countdown.com/

+3

?

, > , IE6 - , . ; , , , , .

?

. , IE6 > , , , >, :

<section class="slide">
  <div>
    <span></span>   <!-- [1] -->
    <div>
      <span></span> <!-- [2] -->
    </div>
  </div>
  <div>
    <p>
      <span></span> <!-- [3] -->
    </p>
  </div>
</section>

, :


  • span div, slide. span div, div. div / .slide.

    .slide span . , , , , .

  • .slide:hover div span
    span div, div div, slide. .

    div , , .slide. , - .slide ( - ).

    .slide span . , , .

  • .slide:hover div span
    span p, div. ; .

    span , , div, .slide.

    .slide span . , , .

Last: in all three scenarios, you will find that the rules apply only to the second selector. This is pure coincidence ; the differences in how supporting browsers look for elements to match are still real.

+2
source

All Articles