For a project, I've got a dynamic megamenu.
In primary menu I have <a>
tag which have URL & #
. I need to assign cursor:pointer
as cursor:default
for the <a>
tag which carries href="#"
.
Is there any possibilities to control using css
<ul>
<li><a href="#">Dummy</a></li>
<li><a href="url.htm">Dummy</a></li>
<li><a href="url.htm">Dummy</a></li>
</ul>
答案 0 :(得分:5)
通过在a标签上使用属性选择器,您可以轻松地检测哪些链接在其href中包含#。
从那里,您只需应用cursor: default
样式即可获得所需的结果。
a[href="#"] { cursor: default }
<ul>
<li><a href="#">Dummy</a></li>
<li><a href="url.htm">Dummy</a></li>
<li><a href="url.htm">Dummy</a></li>
</ul>