我的无序列表出现问题,因为我尝试创建的列表是这样的:
ul.c li {
list-style-type: disc;
background: #F2D7D5;
font-family: 'lato', sans-serif;
margin: 5px;
font-size: large;
}

<ul class="c">
<li>A</li>
<li>B</li>
</ul>
&#13;
编辑: 这是我所有与列表相关的其他代码。我将它用于页面顶部的导航栏:
li {
float: left;
}
li a {
font-family: 'Rye',cursive;
font-size: 20px;
display: block;
color: black;
text-align: center;
padding: 5px 20px;
text-decoration: none;
}
li a, .dropbtn {
display: inline-block;
color: white;
text-align: center;
padding: 8px 61.25px;
text-decoration: none;
background-color: black;
}
li a:hover, .dropdown:hover .dropbtn {
background-color: indianred;
}
li a:hover {
background-color: indianred;
}
li.dropdown {
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
padding: 12px 16px;
z-index: 1;
}
.dropdown-content a {
color: black;
background-color: #f1f1f1;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: white;
}
.dropdown:hover .dropdown-content {
display: block;
}
答案 0 :(得分:-1)
li {
float: left;
}