子菜单 水平到垂直 在 CSS 中



我的当前菜单导航栏在html中: -

您可以通过单击此链接查看我的博客实时:- www.4time2fun.com

<div id="topmenu"> 
<div id="navigation">
<ul class="categories">
<li class="articles"> <a href="#Link"><img src="http://4.bp.blogspot.com/-9vOA-2QWrsA/UF7oc4Cgn5I/AAAAAAAAE1k/hVusG2XkwKU/s1600/home.png"></a></li>
<li class="tags mega"><a href="#">Category 4 Fun</a>
<ul class="two">
<li class="tag-item"><a title="#Title" href="#Link">Accessories</a></li> 
<li class="tag-item"><a title="#Title" href="#Link">Automotive</a></li> 
<li class="tag-item"><a title="#Title" href="#Link">Beauty</a></li> 
<li class="tag-item"><a title="#Title" href="#Link">Clothing/Apparel</a></li>
</ul> </li>
<li class="about"><a href="#Link">Team 2 Hire</a>
</li> <li class="about"><a href="# Link">Who We Are</a></li> 
<li class="articles"><a href="#Link">2 Contact Us</a></li>
</ul> </div></div>

我在 Css 中的当前菜单导航栏: -

#topmenu {
    background: none repeat scroll 0 0 #FBFBFB;
    display: block;
    height: 70px;
    padding-top: 15px;
    text-transform: uppercase;
    width: 990px;
}
#navigation {
    padding: 0 0 5px;
}
#navigation ul li {
    display: inline;
    margin-left: 0;
}
#navigation ul li a {
    padding: 8px 15px;
}
#header #navigation li.mega ul li a {
    font-family: 'Cuprum',arial,serif;
    font-weight: normal;
    text-transform: lowercase;
}
li.mega ul {
    background-color: rgba(255, 255, 255, 0.97);
    border-top: 2px solid #22C3EB;
    padding: 10px 0;
    position: absolute;
    top: 50px;
    z-index: 2;
}
li.mega ul li {
    display: block;
    float: left;
    width: 145px;
}
li.mega ul li a {
    line-height: 30px;
}
#navigation ul li.tags a {
    background: url("http://3.bp.blogspot.com/-ftBEvkZbSMo/TwKvUPTt-II/AAAAAAAAECE/Wrh6HobGwak/s000/arrow_rewards.gif") no-repeat scroll 160px 14px transparent;
    padding-right: 25px;
}
#navigation ul li.tags a:hover {
    background: url("http://3.bp.blogspot.com/-ftBEvkZbSMo/TwKvUPTt-II/AAAAAAAAECE/Wrh6HobGwak/s000/arrow_rewards.gif") no-repeat scroll 160px -10px transparent;
}
#navigation ul li.tags li a, #navigation ul li.tags li a:hover {
    background: none repeat scroll 0 0 transparent;
}
#navigation ul li.tags li a {
    display: block;
    padding: 0 15px;
}
#navigation ul li.tags li a:active {
    border: medium none;
}
#navigation ul li.tags li {
    float: left;
    width: 160px;
}
li.mega ul.two.second {
    display: none !important;
}
li.mega ul {
    left: -9999px;
    position: absolute;
}
li.mega:hover ul, li.mega li ul:hover {
    left: auto;
}
body.category-articles #navigation ul li.articles a, body.category-bestoftheweek #navigation ul li.bestoftheweek a, body.category-about #navigation ul li.about a, body.page-template-page-about-php #navigation ul li.about a, body.page-template-page-contact-php #navigation ul li.contact a {
    background-color: #22C3EB;
    color: #FFFFFF;
}
#topmenu #navigation a {
    color: #616060;
    font-family: 'Cuprum',arial,serif;
    font-size: 18px;
    font-weight: normal;
    text-transform: uppercase;
}
#topmenu #navigation a:hover {
    border-radius: 50px 50px 50px 50px;
    color: #BBBBBB;
}

现在我的子菜单在水平线上打开,现在我想使用 ul 类"二"和 li 类"标签项"在垂直方向上创建我的子菜单(类别 4 乐趣)。

将此

样式添加到您的 CSS 代码中

.two{
  width:100px;
  margin-left:50px;
 }

演示

相关内容

  • 没有找到相关文章

最新更新