gpt4 book ai didi

android - 修复 Android 中的绝对定位

转载 作者:太空狗 更新时间:2023-10-29 15:26:16 26 4
gpt4 key购买 nike

我有自己的网站,它在任何地方看起来都很棒,但我不是 Android 的专业编码员。我不知道它有什么额外的怪癖,我也不确定我真的需要知道多少。有没有办法像在 IE 的条件注释中那样把它挑出来?

Here is my website横幅和 Logo 出现在屏幕左侧。我有一台 Samsung Galaxy 3,这就是我的横幅在上面的样子。

enter image description here

现在我明白为什么会这样了,因为它们都是绝对定位的,显然 margin-left 让它离开了屏幕。但是,如果不破坏所有常规桌面浏览器的布局,我就无法更改它。

    #site-title { background: url(img/heavensgate-logo.jpg) no-repeat; width: 229px;height: 297px; position: absolute; top: 0px; left: 50%; margin-left: -438px; z-index: 2; border: 0px; text-indent: -9999px; }

#banner { position: absolute; top: 165px; width:868px; left: 50%; margin-left: -448px; z-index: 1; padding: 15px; background-color:
#fff; border: 1px solid #b4b4b4; }



<h1 id="site-title"><span><a href="http://heavensgatewinery.ca/" title="Heavens Gate Winery" rel="home">Heavens Gate Winery</a></span></h1>

<div id="banner">
<img src="http://heavensgatewinery.ca/wp-content/uploads/banner8.jpg" style="position: absolute; visibility: hidden; top: 0px; left: 0px; border: 0px none;">
</div>

我对如何让横幅和 Logo 在 Android 上工作感到困惑。任何帮助表示赞赏。

最佳答案

当您需要使用绝对定位来定位元素时,您几乎应该总是在相对定位的元素内进行。

<div style="position:relative;"><div style="position:absolute;"></div></div>

关于android - 修复 Android 中的绝对定位,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11546155/

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