user3066560 user3066560 - 1 month ago 5
CSS Question

Sub elements of a div

I have a piece of code enclosed with

div
tags and containing some sub elements:

<div class="menu">
<ul>
<li>A hurr</li>
<li>A durr</li>
<li>A murrmurr</li>
</ul>
</div>


Now in the tutorial I am reading, in the CSS file he does:

#menu {
width: 550px;
height: 35px;
font-size: 16px;
font-family: Tahoma, Geneva, sans-serif;
font-weight: bold;
text-align: center;
text-shadow: 3px 2px 3px #333333;
background-color: #8AD9FF;
border-radius: 8px;
}


And then:

#menu ul {
height: auto;
padding: 8px 0px;
margin: 0px;
}


To change the appearance of the
ul
element.

I assume that this is an older version of CSS since we now use
.menu
not
#menu
and now it doesn't seem to work to type
menu ul { blabla }


How do I change the appearance of sub element
ul
in todays CSS?



#menu {
width: 550px;
height: 35px;
font-size: 16px;
font-family: Tahoma, Geneva, sans-serif;
font-weight: bold;
text-align: center;
text-shadow: 3px 2px 3px #333333;
background-color: #8AD9FF;
border-radius: 8px;
}
#menu ul {
height: auto;
padding: 8px 0px;
margin: 0px;
}

<div class="menu">
<ul>
<li>A hurr</li>
<li>A durr</li>
<li>A murrmurr</li>
</ul>
</div>




Answer

if i understand your question, you can do this :

.menu ul li {
    //properties
}

You just have to replace your #menu by .menu , because you put it as a class in the html code.

Comments