gpt4 book ai didi

CSS3 媒体查询问题

转载 作者:行者123 更新时间:2023-11-28 11:13:51 24 4
gpt4 key购买 nike

我认为我只为 500px1024px 之间的屏幕设置的规则甚至在超过 1024px 的屏幕尺寸上也适用。

这是 CSS。 .red 样式在小于 480px 的屏幕上正确应用。只是黄色应用于所有屏幕,即使是那些超过 1024pxmax-width

.buy {
border: 1px solid #ABABAB;
color: #333333;
display: block;
font-family: calibri,helvetica,sans-serif;
font-size: 12px;
font-weight: bold;
height: 25px;
line-height: 25px;
margin: auto;
text-align: center;
text-decoration: none;
width: 70px;
}

@media only screen and (max-width: 480px) {
.buy {
color: red;
}
}

@media screen and (max-width: 1024px) and (min-width: 500px) {
.buy {
color: yellow;
}
}

最佳答案

你只忘记了

@media only screen and (min-width: 500px) and (max-width: 1024px) {
.buy {
color: yellow;
}
}

关于CSS3 媒体查询问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11990041/

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