which is better for use
.menu{
float:left;
width:600px;
height:25px;
background:url(bg.png) repeat-x;
}
.menu ul{
float:left;
}
.menu ul li{
float:left;
width:150px;
height:25px;
background:#F00;
}
or
.menu{
float:left;
width:600px;
height:25px;
background:url(bg.png) repeat-x;
}
.menu ul{
float:left;
}
.menu li{
float:left;
width:150px;
height:25px;
background:#F00;
}
which tag is right menu ul li or menu li?
When you say
which tag is right menu ul li or menu li?, are you talking about a div withclass="menu"or are you talking about the deprecated menu tag (<menu>)?If you are just talking about your css code, those are not tags, they are selectors. And I’d go with the most specific selector available in order to avoid accidental assignments
even better would be this:
or, if you have multiple menus:
because otherwise you are in for surprises, you might actually have a structure like this:
(this is ugly, I know, but just to prove a point)
(you probably don’t want to match items abc or xyz).