【问题标题】:Remove underline from <li> elements [duplicate]从 <li> 元素中删除下划线 [重复]
【发布时间】:2021-03-08 17:51:39
【问题描述】:

是的,我尝试使用 text-decoration: none,但它似乎没有做任何事情。这是我的CSS:

.search-result 
{
    margin-left: -50px;
    padding: 20px;
    text-decoration: none;
    color: #2f2f2f;
}

这是我的html:

<ul style="list-style-type: none" id="myUL">
    <li class="search-result-other-pages">
        <a>
            Početna
        </a>
    </li>
    <li class="search-result">
        <a href="novosti-pc.html">
            Novosti
        </a>
    </li >
    <li class="search-result">
        <a>
            Galerija
        </a>
    </li>
    <li class="search-result">
        <a>
           MMA
        </a>
    </li>
</ul>

以前从未发生过。上次它使用 text-decoration: none,但现在它没有。如果有人知道如何解决这个问题,请回答。谢谢!

【问题讨论】:

    标签: html css html-lists


    【解决方案1】:

    链接有下划线,而不是LIs。

    .search-result a {text-decoration: none}
    

    【讨论】:

      【解决方案2】:
      #myUL li a {text-decoration: none}
      

      【讨论】:

        猜你喜欢
        • 2022-11-24
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-11-05
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-05-14
        相关资源
        最近更新 更多