gpt4 book ai didi

jquery - 移动 anchor 带有 ids 和 css 的标签

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

我有一个很长的垂直视差网站。

该网站的移动版本略有不同,但使用相同的 anchor 共享相同的导航。

我正在尝试将 id 添加到 anchor 标记 - 这样我就可以在移动分辨率下使用 css 移动它们。

<a id="anchor1" href="#anchor1"></a>

但它没有被阅读——有什么建议吗?

@media(max-width:700px) and (min-width:100px) { 

a#anchor1 { margin-top:-110px; position:absolute;}

最佳答案

你错过了屏幕部分,我会找到另一种方法来获取元素而不是 id,要么是 a[href="#"] 要么把类放在 anchor 上,否则你将不得不把代码写成时间取决于您有多少个链接。

@media screen and (max-width:700px) and (min-width:100px) { 

a#anchor1 { margin-top:-110px; position:absolute;}
}

关于jquery - 移动 anchor 带有 ids 和 css 的标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27912184/

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