Can someone explain the difference for these two CSS selectors?
.work-container . h3 {
font-size: 14px;
margin-top: 0px;
font-weight: 600;
height: 27px;
}
What is the extra dot in the upper definition?
.work-container h3 {
font-size: 14px;
margin-top: 0px;
font-weight: 600;
height: 27px;
}
A
.prefix usually represents a class selector, but if it’s immediately followed by whitespace then it’s a syntax error.If I were to hazard a guess, then it’s likely the author meant to say
.work-container > h3, but missed the Shift key just as he was about to type the>character (the child combinator).Your second selector,
.work-container h3, simply means anyh3that’s contained within an element with a class calledwork-container.