移动浏览器显示 (iPhone) 的 CSS 问题

发布于 2024-12-04 02:25:32 字数 264 浏览 0 评论 0原文

我正在使用 float: left; margin-left: -100px; 对于我之前的按钮,以及 float: right; margin-right: -100px; 用于我的“下一个”按钮。虽然这在我的常规浏览器的固定宽度网站上完美运行,但我在移动显示方面遇到了麻烦。

手机似乎通过采用最大的容器并添加一点填充来“缩放”网站,不幸的是我的“下一个”和“上一个”按钮似乎没有注册,导致它们在屏幕边缘被切成两半在移动浏览器上。

有人能解决这个问题吗?

I'm using float: left; margin-left: -100px; for my previous button, and float: right; margin-right: -100px; for my 'next' button. While this works perfectly on my fixed-width website for regular browsers, I'm running into trouble with the mobile display.

It appears mobile phones "scale" websites by taking the largest container and adding a little padding, and unfortunately my 'next' and 'previous' button don't appear to register, causing them to be cut in half at the edges of the screen on the mobile browser.

Does anyone have a fix for this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

暮凉 2024-12-11 02:25:32

在没有看到所有代码的情况下很难提出具体的补救措施,但我怀疑您可以从视口元标记中获得一些里程:

请参阅像素不是像素不是来自PPK

Difficult to suggest a specific remedy without seeing all the code, but I suspect you could get some mileage out of the viewport meta tag: <meta name="viewport" width="device-width">

See A pixel is not a pixel is not a pixel from PPK

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文