但我认为在这种情况下,将链接放在“div”中是一种不好的做法。您可以简单地为链接注册一个类,并为此类编写样式。
.navigation {
padding: 40px 0px;
position: relative;
text-align: center;
width: 100%;
font-size: 30px;
}
.navigation a {
background: black;
border: 1px solid grey;
border-radius: 7px;
color: white;
display: inline-block;
margin: 100px 35px;
padding: 14px;
text-decoration: none;
opacity: 0.75;
font-family: impact;
}
.navigation a:hover {
background: white;
border: 1px solid black;
color: black;
}
#contact a {
background: white !important;
color: black !important;
}
<div class="navigation">
<a href="./productions.html">Mes productions</a>
<a href="./DJ.html">DJ</a>
<a target="_blank" href="./CV.pdf">Mon CV</a>
<div id="contact">
<a href="./contact.html">Me contacter</a>
</div>
</div>