html - Syntax questions: What is right to do? -
if have kid within div id, example, id="mother"
, how correctly write css?
example:
1) #mother ul li {...}
or
2) mother ul li {...}
is there difference? sec illustration saw when mother had class name, not id.
your first approach right 1 when have:
html:
<div id="mother"> <ul> <li>first child</li> <li>secondchild</li> </ul> </div>
css:
#mother ul li { color:red; }
your sec approach have alter this:
div ul li { color:red; }
html css syntax
No comments:
Post a Comment