【发布时间】:2021-08-05 13:44:50
【问题描述】:
我试图避免在我的<a> 标签下出现下划线。我已经根据文档添加了 "no-underline" 类,但我的链接下仍然有下划线?我在下面添加了代码:
<div
class="
my-3
flex flex-wrap
-m-1
text-center
justify-center
items-center
no-underline
"
>
<div class="m-auto">
{% for tag in tags %}
<a
href="{% routablepageurl blog_page 'post_by_tag' tag.slug %}"
class="no-underline"
>
<span
class="
font-mono
m-1
bg-gray-200
hover:bg-gray-300
rounded-full
px-2
py-1
font-bold
text-sm
leading-loose
cursor-pointer
shadow-lg
no-underline
"
>{{ tag }}</span
>
</a>
{% empty %} No tags yet {% endfor %}
</div>
</div>
Thanks for the help!
【问题讨论】:
-
该类的样式表是什么?通常是
text-decoration: none; -
另一个观察是你的班级有这么多班级,
hover:bg-gray-300这不是班级 -
@Bharat,我使用的是tailwindCSS,你提到的类是内置的,我使用的是命名约定。
-
啊,我明白了。谢谢
标签: html css tailwind-css