gpt4 book ai didi

html - 删除文本装饰下划线,为 :after in css

转载 作者:太空狗 更新时间:2023-10-29 14:40:48 25 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
“text-decoration” and the “:after” pseudo-element
“text-decoration” and the “:after” pseudo-element, revisited

我正在使用 <a> 制作导航链接标签下面是html

<div class="nav_container">
<a class="panel" href="demolink">menu1</a>
<a class="panel" href="demolink">menu2</a>
<a class="panel" href="demolink">menu3</a>
</div>

并应用 :after css 属性为分隔线放置管道

.panel:after{
content:"|";
margin-left: 4px;
margin-right: 4px;
}
.panel:last-child:after{
content:"";
}

我想在选择菜单时加上下划线,因为我正在应用一个名为 selected 的类

.panel.selected {
text-decoratoion:underline;
}

但问题是菜单“|”之后的管道也有下划线,我想删除它。我什至尝试更改 .panle:after 的 css如下,

.panel:after{
content:"|";
margin-left: 4px;
margin-right: 4px;
text-decoration:none;
}

但是下划线还在。

任何建议,谢谢。

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com