我想有一个导航栏,有白色的文本链接,而不是它的下划线,但相反,它已经出现了一个div中的基本链接,所以一直没有工作,但我不知道缺少什么。
任何建议都将是apricated.I wanted to have a navigation bar that has white text links without underlined and instead it has appeared with basic links in a div so hasn't worked but I don't know what is missing.
<html>
<style>
.box3{
padding:7px;
background: black;
font-family: arial;
font-size:15px;
}
</style>
<div class="box3">
<a href="#home">Home</a>
<a href="#about">About</a>
<a href="#contact">Contact</a>
</div>
</html>
你需要为你的链接添加样式,例如你可以添加
.box3 a {
color: white;
text-decoration: none;
}
这将把颜色改为白色,并删除下划线。
.box a { css }
将只针对box3 div内的a标签。
.box3 {
padding: 7px;
background: black;
font-family: arial;
font-size: 15px;
}
.box3 a {
color: white;
text-decoration: none;
}
<div class="box3">
<a href="#home">Home</a>
<a href="#about">About</a>
<a href="#contact">Contact</a>
</div>