gpt4 book ai didi

html - 当我更改屏幕大小时,如何调整网页上的链接按钮

转载 作者:行者123 更新时间:2023-11-28 02:01:45 25 4
gpt4 key购买 nike

我的链接的 html5 代码是这样写的

<nav class="firstlinks">
<a href="Strengthtraining.html"> Strength training</a>
<a href="hypertrophy.html"> hypertrophy training</a>
<a href="endurance.html"> endurance training</a>
</nav>

我的链接的css3代码是这样写的

a {
Color: gold;
Background-color: black;
Padding: 1% 1.5%;
Margin-right: 5%;
Boreder-radius: 50%;
Border: 1px solid black;
Text-decoration: none;
}

a:visited{
Color: gray;
}

a:hover{
Color: green;
}

最佳答案

您可以使用 CSS3 media queries , 根据屏幕宽度应用不同的 CSS。

例如

div { border: 1px solid red; }

@media screen and (max-width: 800px) {
div { border: 1px solid blue; }
}
<div>Foobar</div>

关于html - 当我更改屏幕大小时,如何调整网页上的链接按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49269241/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com