I have a question about css selectors.
Say I have the following html
<div class="message">
<div class="messageheader">
<div class='name'>A news story</div>
</div>
</div>
In the css I could refer to the class
called name
either like this
div.message div.messageheader div.name {}
or
.name {} /* ie *.name{} */
Is one way better than the other?
I understand that if I have an additional "instance" of the class called name
, ie
<div class="message">
<div class="messageheader">
<div class='name'>A news story</div>
</div>
</div>
<a class='name'>A news story</div>
I could use div.message div.messageheader div.name {}
to refer the first instance and a.name {}
to the second instance, but I am interested in the initial scenario only.