有人可以幫我弄清楚如何將我的菜單欄(w/id =「topnav」)放在我的HTML頁面頂部?我嘗試了一些背景大小的東西,似乎沒有任何工作。我希望它是固定的,並在滾動時水平填充頁面。在CSS中格式化topnav
#topnav a{
text-decoration: none;
color: #000;
padding-left: 50px;
padding-right: 50px;
padding-bottom: 10px;
}
#topnav{
font-family: Courier;
text-align: center;
padding: 15px;
position: fixed;
left: 50%;
transform: translateX(-50%);
background: white;
/*background-size: 100% auto !important;*/
}
也提供您的HTML –