I'm a teacher, teaching basic HTML and CSS in a high school. Last week we discussed and practice lists, and this week we are on the topic of div classes. I'm trying to put a list into a div, while using *
to eliminate unwanted space within and around the div. By doing this, the lists are no longer staying in the div. What do I need to do to get the list numbers inside of the div?
.wrapper {
width: 85%;
margin-right: auto;
margin-left: auto;
}
.div1 {
background-color: green;
padding: 10px
}
* {
margin: 0px;
padding: 0px
}
<div class="wrapper">
<div class="div1">
<h2>Famous Dishes</h2>
<ul style="list-style-type:square">
<li>Baden-Württemberg</li>
<ol type="a">
<li>Maultaschen</li>
<li>Brenntar</li>
<li>Sauerbraten</li>
<li>Sauerkraut</li>
<li>Spätzle, Knöpfle</li>
</ol>
<li>Bavaria</li>
<ol type="a">
<li>Weißwürste</li>
<li>Weizenbier/Weißbier</li>
<li>Helles Bier</li>
<li>Radler</li>
</ol>
<li> Berlin</li>
<ol type="a">
<li>Buletten</li>
<li>Currywurst</li>
<li>Eierkuchen</li>
<li>Eisbein</li>
</ol>
</ul>
</div>
</div>