What is the difference between these two classes?
source link: https://www.codesd.com/item/what-is-the-difference-between-these-two-classes.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
What is the difference between these two classes?
I don't know how they are different in css
something
{
//some properties
}
something >.somethingelse
{
// something else's properties
}
something
{
//some properties
}
something .somethingelse
{
// something else's properties
}
I don't know why there is such a >
in the second case. Should there also be a <
for use too ?
The >
indicates that direct children somethingelse
are found under something
. Otherwise descendants will be found at all levels.
So using this following example:
<div class="something">
<div class="somethingelse">
<div class="somethingelse">
</div>
</div>
</div>
For the >
example only the outer somethingelse
div will take effect. For the example without >
both divs will have the style applied.
<
might imply a parent selector (ie apply a style to the direct parent of a matching class). I'm not aware of this existing yet, but theres an interesting post on it a csstricks here.
Related Articles
What is the difference between these two class definitions?
What is the difference between these two statements:
What is the difference between these two methods for pause / resume threads?
What is the difference between these two selectors using ": not"?
What is the difference between these two JavaScript inheritance methods?
What is the difference between these two ways to launch in Java?
What are the differences between these two statements?
What is the difference between these two statements (asp.net/c#/entity framework)
What is the difference between these two SQL queries?
What is the difference between these two expressions in an anonymous Scala function?
What is the difference between these two ways to save data in CakePHP
What is the difference between these two cases of adding a string?
What are the differences between these two questions?
What is the difference between these two pieces of Python code?
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK