2 回答
TA贡献1891条经验 获得超3个赞
您的代码中有一个错误的括号:
#appetizer
{
background-color: #009933;
{ /* wrong bracket */
代替
#appetizer
{
background-color: #009933;
}
TA贡献1828条经验 获得超3个赞
这是一个工作版本,为简洁和外观做了一些修改。
.d1 { text-align: center; width: 20%; height: 100%; float: left; }
.p1 { margin-top: 65px; }
#breakfast { background-color: red; }
#sweets { background-color: skyblue; }
#appetizer { background-color: #009933; } /* <-- The issue was here */
#food { background-color: lime; }
#drink { background-color: blue; }
<div id="navigationbar">
<div class="d1" id="breakfast">
<p class="p1"> Breakfast </p>
</div>
<div class="d1" id="sweets">
<p class="p1"> Sweets </p>
</div>
<div class="d1" id="appetizer">
<p class="p1"> Appetizer </p>
</div>
<div class="d1" id="drink">
<p class="p1"> Drink </p>
</div>
<div class="d1" id="food">
<p class="p1"> Food </p>
</div>
</div>
添加回答
举报