2
我的目標是爲我的投資組合製作一個網站。 我有一個div的菜單,想要在另一個div上工作,作爲我的所有圖像的容器。圖像必須填充瀏覽器的100%高度。 問題是,我希望我的網站水平滾動,當我開始添加內容時,只要寬度超過瀏覽器窗口的100%,新圖像會在第一個圖像下進行水平滾動。水平滾動網站內容
我能做些什麼來糾正呢?
CSS
body, html {
height: 100%;
}
#main {
width: 100%;
height: 100%;
background-color: #000;
position: absolute;
top: 0px;
left: 0px;
z-index: 1;
}
#menu {
width: 200px;
height: 500px;
background-color: #fff;
position: absolute;
top: 10px;
left: 10px;
overflow: scroll;
z-index: 2;
}
#img {
height: 100%;
float: left;
overflow: scroll;
}
你可以添加你使用的HTML佈局嗎?此外,您可能希望使用不同於'#img'的div id,因爲它接近html屬性。 – Abernasty