简体   繁体   English

菜单列表项的样式不同

[英]Different style for menu list items

I have the following sidebar menu: 我有以下边栏菜单:

<div id="sidebar-wrapper" style="margin-right:-2%">
        <ul class="sidebar-nav">
            <li class="sidebar-brand">
                <a href="#">
                    foo
                </a>
            </li>
            <li>
                <div class="accordion" id="accordion2">
                <div class="accordion-group">
                <div class="accordion-heading">
                <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapsepro">
                    proyectos
                </a>
                </div>
                <div id="collapsepro" class="accordion-body collapse in">
                <div class="accordion-inner">
                    <a href="casas.php">casas</a>
                    <a href="condominios.php">condominios</a> 
                </div>
                </div>
                </div>                   
            </li>
        </ul>
    </div>

The "li" elements have this CSS code “ li”元素具有此CSS代码

.sidebar-nav li {
text-align: center;
line-height: 65px;
font-size: 16px;
border-bottom-style: solid;
border-bottom-color: grey;
list-style-type: none;
}

.sidebar-nav li a {
display: block;
text-decoration: none;
color: #999999;
list-style-type: none;
}

How can I override the styles for 如何覆盖样式

 <div class="accordion-inner">
                    <a href="casas.php">casas</a>
                    <a href="condominios.php">condominios</a> 
 </div>

to have different rules than the other "a" links, so that they look different (smaller, less line space, etc.)? 是否具有与其他“ a”链接不同的规则,从而使它们看起来有所不同(更小,更少的行距等)? So basically change the style of the accordion items. 因此,基本上改变了手风琴项目的样式。 I would really appreciate the help! 我非常感谢您的帮助!

.accordion-inner a{
    font-size: smaller !important;
    line-height: 10px !important;
    ...other styles
}

!important will override any other styles applied to the anchors whether directly or inherited. !important将覆盖应用于锚的任何其他样式,无论是直接样式还是继承样式。

You can use the below class to sytle the links within 'accordion-inner' div 您可以使用下面的类来修饰“ accordion-inner” div中的链接

.sidebar-nav li #collapsepro .accordion-inner a{
    /* Your style goes here. */
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM