【问题标题】:Center from CSS a <li>从 CSS 居中 <li>
【发布时间】:2018-02-05 20:35:46
【问题描述】:

我有一个问题。
我想将带有&lt;li&gt; 标签的菜单居中,并且我有两个按钮。

.subiectele-zilei {
    width:100%;
    padding-left: 25px;
    overflow:hidden;
    padding-bottom:8px;
    background-color:#f5f5f5;
    margin-top:2px;

    border-bottom:1px solid #ccc;
}
.subiectele-zilei li {
    display:block;
    float:left;
    font-family: 'Roboto Condensed', Helvetica Neue, Helvetica, Arial, sans-serif;
    font-weight:bold;
    font-size:18px;
    color:#008cff;
    text-shadow:0 1px 0 rgba(255,255,255,.75);
    margin-left:15px;
    margin-right:14px;
}
.subiectele-zilei li a {
    background: #ffffff;
    background: -moz-linear-gradient(top,  #ffffff 0%, #e5e6e6 100%);
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#e5e6e6));
    background: -webkit-linear-gradient(top,  #ffffff 0%,#e5e6e6 100%);
    background: -o-linear-gradient(top,  #ffffff 0%,#e5e6e6 100%);
    background: -ms-linear-gradient(top,  #ffffff 0%,#e5e6e6 100%);
    background: linear-gradient(to bottom,  #ffffff 0%,#e5e6e6 100%);
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#e5e6e6',GradientType=0 );
    border-radius:100px;
    padding:2px 15px 3px;
    box-shadow:0 1px 0 #b8b8b8, inset 0 1px 0 #fff;
    display:block;
    margin-top:11px;
    margin-right:8px;
    float:center;
    margin-left:55px;

}

&lt;li&gt; TEXT&lt;/li&gt; 我放在 100% 宽度的中心。

【问题讨论】:

  • 也发布你的html?

标签: html css html-lists center


【解决方案1】:

是的,在这里:

HTML

<div class="subiectele-zilei">
        <ul>
        <li><a href="https://observatorulnational.ro/cazul-comisarului-berbeceanu/">CAZUL COMISARULUI BERBECEANU</a></li>
        <li><a href="https://observatorulnational.ro/observatorul-national-live/">OBSERVATORUL NA&#x21a;IONAL LIVE</a></li> 
        </ul>
    </div>

【讨论】:

    猜你喜欢
    • 2012-02-19
    • 2018-05-17
    • 2014-04-09
    • 2023-03-10
    • 1970-01-01
    • 1970-01-01
    • 2014-04-12
    • 2011-03-24
    • 1970-01-01
    相关资源
    最近更新 更多