這可能是一個非常基本的問題,但我經過幾個小時的搜索找不到任何幫助,所以我發佈了它。使用無序列表製作菜單?
我想要使用無序列表來獲得像這樣的菜單。
在我的情況下,所有額外的列表項熄滅的div,所以我所有的浮動li元素到左側,但有新的問題。當底部沒有更多空間時,我希望李立在一邊,但即使底部有空間,他們也總是站在一邊。例如。在下面的圖像,我想「婦女」是下面不就在身邊「MEN」列表(「不要採取了錯誤的方式,如果你知道我的意思;))
所以誰能幫我
HTML
<div class="wrapper">
<div class="list">
<ul>
<li class="">
<a href="#" class="heading">ELECTRONICS</a>
<ul><li>
<a href="#" class="item">Mobiles</a></li><li>
<a href="#" class="item">Tablets</a></li><li>
<a href="#" class="item">Laptops</a></li><li>
<a href="#" class="item">Network Components</a></li><li>
<a href="#" class="item">Computer Peripherals</a></li><li>
<a href="#" class="item">Mobile Accessories</a></li><li>
<a href="#" class="item">Television</a></li><li>
<a href="#" class="item">Home Appliences</a></li><li>
<a href="#" class="item">Kitchen Appliences</a></li><li>
<a href="#" class="item">Kitchen Appliences</a></li><li>
<a href="#" class="item">Gaming</a></li><li>
<a href="#" class="item">Cameras</a></li></ul>
</li>
<li>
<a href="#" class="heading">MEN</a>
<ul>
<li><a href="#" class="item">Clothing</a></li>
<li><a href="#" class="item">Footware</a></li>
<li><a href="#" class="item">Watches</a></li>
<li><a href="#" class="item">Accessories</a></li>
<li><a href="#" class="item">Spectacle Frames</a></li>
<li><a href="#" class="item">Bag, Belts & Wallets</a></li>
<li><a href="#" class="item">Sunglasses</a></li>
<li><a href="#" class="item">Fragrances</a></li>
<li><a href="#" class="item">Grooming & Wellness</a></li>
</ul>
</li>
<li>
<a href="#" class="heading">WOMEN</a>
</li>
<li>hello></li>
<li>hello></li>
<li>hello></li>
<li>hello></li>
</ul>
</div>
</div>
CSS
.wrapper {
display:
none;
height: 400px;
width: 1266px;
}
.wrapper > di ul {
float: lft;
}
.wrapper div {
height: 100%;
width: 100%;
background-color: inherit;
padding-top: 30px;
}
.list a.heading {
font-size: 17px;
font-weight: bold;
padding-bottom: 10px;
padding-right: 10px;
}
.list a.item {
font-size: 15px;
font-family: raleway, sans-serif;
padding-left: 10px;
padding-top: 9px;
padding-right: 10px;
}
.list > ul > li {
float: left;
}
請分享您的代碼 –
你能後你做了什麼這麼遠嗎?我明白這張照片就是你想要的。但如果我們現在沒有現在的東西,我們不能幫助你。 – Eria