1 回答
TA贡献1831条经验 获得超10个赞
您可以设置display: block;并.gm li a使用transform:scale:
body {
margin: 0px;
padding: 0px;
background-attachment: fixed;
background-image: linear-gradient(-120deg, #f5eeed, #ccaeab);
}
header {
margin: 0px;
padding: 0px;
}
.hhh {
position: absolute;
font-family: 'Fredoka One', cursive;
font-size: 40px;
left: 8%;
top: 4%;
}
.hhh a {
text-decoration: none;
}
.hhh a:active {
color: black;
}
.hhh a:visited {
color: black;
}
.hhh a:hover {
color: black;
opacity: 0.8;
font-size: 110%;
}
.hhh a:link {
color: black;
}
.gm {
position: absolute;
display: flex;
left: 55%;
top: 7%;
font-family: 'Fredoka One', cursive;
font-size: 20px;
}
.gm li {
margin-left: 35px;
list-style-type: none;
}
.gm li a {
display: block;
text-decoration: none;
}
.gm li a:active {
color: black;
}
.gm li a:hover{
transform: scale(1.1);
}
<link href="https://fonts.googleapis.com/css2?family=Fredoka+One&display=swap" rel="stylesheet">
<header>
<nav>
<h1 class="hhh"><a href="#"> THIS IS MY WEBPAGE </a></h1>
<ul class="gm">
<li><a href="#">Home</a></li>
<li><a href="#">Photos</a></li>
<li><a href="#">Games</a></li>
<li><a href="#">News</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</header>
<main>
</main>
<footer>
</footer>
- 1 回答
- 0 关注
- 80 浏览
添加回答
举报