删除wordpress网站上链接的下划线。 text-decoration:none;不起作用

时间:2018-05-21 08:59:05

标签: html css hyperlink

在你标记为重复之前:我已经阅读了所有类似的问题并尝试了解决方案,要么我太愚蠢了解它们(一种有效的可能性),或者我的问题不同,但它们不起作用对我来说。

我在wordpress论坛上被标记为主题,因为它显然是一个css / html问题,所以我转发到这里。

现在解决问题:

我无法删除我网站上某些链接的下划线。这是我对链接的html定义:

<p style="text-align: center;">
    <a class="buttonL" href="http://cns.uni.lu/homel">&lt;</a>
    <a class="buttonR" href="http://cns.uni.lu/homer">&gt;</a>
</p>

我的CSS来自“自定义CSS”页面:

.buttonL {
    border-radius: 50%;
    position:fixed;
    top: 50%;
    left: 0%;
    background-color: transparent;
    border: none;
    color: grey;
    padding: 5px 20px;
    text-align: center;
    text-decoration: none !important;
    display: inline-block;
    font-size: 50px;
    margin: 4px 2px;
    cursor: pointer;
    font-weight: 900;
}

.buttonR {
    border-radius: 50%;
    position:fixed;
    top: 50%;
    right: 0%;
    background-color: transparent;
    border: none;
    color: grey;
    padding: 5px 20px;
    text-align: center;
    text-decoration: none !important;
    display: inline-block;
    font-size: 50px;
    margin: 4px 2px;
    cursor: pointer;
    font-weight: 900
}

我知道这是多余和不优雅的。没有用评论。我可以在以后使它更优雅。

出于某种原因,链接下方有一条线,不会消失。我尝试过使用

text-decoration:none !important;

,但无济于事。我已经将它应用于.buttonL,.buttonR,a,.buttonL a,.buttonR a,.buttonL:l​​ink,.buttonL:active,.buttonR:link,.buttonR:active,.buttonL a:link,.buttonL a:active,.buttonR a:link,.buttonR a:active。

我也尝试过做

border-bottom: none;

box-shadow: none;

,也无济于事。

关于我做错了什么的想法?

P.S。我无法链接我正在引用的页面,因为它位于内部网络上。遗憾...

以下是该页面的屏幕截图: The links in question are the arrows to either sides. Although the other links have the same problem.

3 个答案:

答案 0 :(得分:1)

我刚刚找到解决方案:

由于某种原因,背景渐变(虽然它是白色的)在背景边框(或中心 - 我不确定)留下了一条线。要删除它,我添加了

.entry-content a{background-image:none;}

到css文件,而不是让它透明。

感谢所有帮助:D

答案 1 :(得分:0)

使用此CSS可能对您有所帮助

public abstract class Parent
{
    protected static Data createData(String d1, ...) {
        return new Data(d1, ...);
    }

    public static class Data
    {
        public final String data1
        ...

        private Data(String d1, ...)
        {
            data1 = d1;
            ...
        }
    }

    public abstract Data getData();
}

或使用

   body .buttonL, body .buttonR {
        text-decoration: none !important;
    }

答案 2 :(得分:0)

如果css不起作用,则使用jquery

<script>
    $(document).ready(function(){
        $('.buttonL').css('text-decoration','none');
        $('.buttonR').css('text-decoration','none');
    });
<script>

我希望这能解决你的问题。