I have realized that the css selector
"#id.classname"
vs
"#id .classname"
is not the same. See the whitespace in the 2nd sample.
What is the difference between those two?
I thought both mean a class applied to an element with that id.
I have realized that the css selector
"#id.classname"
vs
"#id .classname"
is not the same. See the whitespace in the 2nd sample.
What is the difference between those two?
I thought both mean a class applied to an element with that id.
The whitespace makes a huge difference because it is the descendant selector combinator.
The first selector applies to an element with id id
that has the class classname
.
The second applies to an element that has the class classname
which is also a descendant of the element with id id
.