新手CSS问题。可以用类做链接不做链接吗?

问题描述 投票:0回答:1

在这里输入图片描述我在最开始的时候,做了一个导航栏,改动了我现在的导航栏。我只想知道,能不能让我现在所在的页面的链接,不出现带类的链接,还是要直接删除A中的href?


   <nav>
        <a href="index.html" > Home </a> |   

        <a> About</a> |

       <!---- <a href="about.html" class="youarehere" > About</a> | -->

        <a href="Study.html"> Inspiration</a>  
    </nav>

css
1个回答
0
投票
<a href=https://somesite.com" class="someclass">Link</a>

A HREF是需要链接的,因为它是超文本引用。类是可选的,但可以用来做样式,即。

.someclass {color: red; font-size: 20px;}
© www.soinside.com 2019 - 2024. All rights reserved.