gpt4 book ai didi

css - @media CSS 代码中的错误。应该很简单

转载 作者:太空宇宙 更新时间:2023-11-04 04:01:19 25 4
gpt4 key购买 nike

我正在尝试使用@media 命令将我网站的一个元素设置为不同的移动浏览高度,但我似乎无法让代码正常工作。如果这里有人能看到我哪里出错了并指出正确的方向,我将不胜感激。

body .gilidPanel-opener {
top: 55%;
}

@media all and (max-width: 700px){
body .gilidPanel-opener {
top: 85%;
}
}

最佳答案

由于 position 属性值默认为 static,您需要提供不同的值,例如 absolutefixedrelative 使您的 top 属性有效,所以请尝试:

body .gilidPanel-opener {
position: relative; /* or absolute or fixed */
top: 55%;
}

@media all and (max-width: 700px){
body .gilidPanel-opener {
position: relative; /* or absolute or fixed */
top: 85%;
}
}

关于css - @media CSS 代码中的错误。应该很简单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22030747/

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