Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/77.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 无法使文本装饰消失_Html_Css - Fatal编程技术网

Html 无法使文本装饰消失

Html 无法使文本装饰消失,html,css,Html,Css,我有一排菜单按钮。我希望它们在没有相互作用时是绿色的,在悬停时是亮绿色的。在任何场景中都没有下划线或蓝色文本。但无论我做什么,我在盘旋前会变成蓝色,在盘旋时会变成蓝色下划线。与我想要实现的恰恰相反 我已经从我能想到的每一个方面考虑过了。我覆盖了所有可能的属性,但没有任何东西能坚持。谁能告诉我我做错了什么?谢谢 html <div id="menu-buttons"> <div class="link"><a href="https://www....">

我有一排菜单按钮。我希望它们在没有相互作用时是绿色的,在悬停时是亮绿色的。在任何场景中都没有下划线或蓝色文本。但无论我做什么,我在盘旋前会变成蓝色,在盘旋时会变成蓝色下划线。与我想要实现的恰恰相反

我已经从我能想到的每一个方面考虑过了。我覆盖了所有可能的属性,但没有任何东西能坚持。谁能告诉我我做错了什么?谢谢

html

<div id="menu-buttons">
    <div class="link"><a href="https://www....">btn 1</a></div>
    <div class="link"><a href="https://www....">btn 2</a></div>
    <div class="link"><a href="https://www....">btn 3</a></div>
    <div class="link"><a href="https://www....">btn 4</a></div>
    <div class="link"><a href="https://www....">btn 5</a></div>
</div>
问题:

1-您的选择器不正确更改
#菜单按钮。将
链接到
#菜单按钮。链接a

2-选择器的顺序不正确

根据:

注意:悬停必须在:link和:visted之后(如果它们存在) 在CSS定义中,为了有效


您的CSS代码在文本对齐:居中后缺少“}”在第一行的末尾

这就取消了代码的其余部分

将其替换为此代码

#menu-buttons {display:inline-block; float:right; padding-top:30px; text-align:center;} 

#menu-buttons .link:hover {text-decoration:none; color:#92f200;}
#menu-buttons .link:link {text-decoration:none; color:#92f200;}
#menu-buttons .link:active {text-decoration:none; color:#92f200;}
#menu-buttons .link {
    display:inline-block;
    width:auto; 
    margin-right:20px; 
    color:#73bf00;
    background:transparent; 
    vertical-align:bottom;
    font-size:small;
    text-transform:uppercase;
    text-decoration:none;
}

a {text-decoration:none; color:#73bf00;}
a:visited{text-decoration:none; color:#73bf00;}
a:hover {text-decoration:none; color:#92f200;}
a:visited:hover {text-decoration:none; color:#92f200;}
a:link, a:active {text-decoration:none;}

a{文本装饰:无;颜色:#73bf00;}a:访问了{文本装饰:无;颜色:#73bf00;}对我有效,你确定它们不起作用吗?@Randall它能解决你的问题吗?是的。多谢各位@兰德尔:太好了。祝你好运,对不起。我在原来的帖子上打错了字。我对它进行了编辑以匹配代码中的内容。对不起,给你添麻烦了。不过接得好!
#menu-buttons {display:inline-block; float:right; padding-top:30px; text-align:center;} 

#menu-buttons .link:hover {text-decoration:none; color:#92f200;}
#menu-buttons .link:link {text-decoration:none; color:#92f200;}
#menu-buttons .link:active {text-decoration:none; color:#92f200;}
#menu-buttons .link {
    display:inline-block;
    width:auto; 
    margin-right:20px; 
    color:#73bf00;
    background:transparent; 
    vertical-align:bottom;
    font-size:small;
    text-transform:uppercase;
    text-decoration:none;
}

a {text-decoration:none; color:#73bf00;}
a:visited{text-decoration:none; color:#73bf00;}
a:hover {text-decoration:none; color:#92f200;}
a:visited:hover {text-decoration:none; color:#92f200;}
a:link, a:active {text-decoration:none;}