如何调整 HTML 中表单的大小以填充移动设备的屏幕?

发布于 2024-10-04 06:44:19 字数 114 浏览 0 评论 0原文

我创建了一个用于登录的 html 页面,其中包含页面左上角的用户名和密码字段。我希望当在 Android 模拟器浏览器中查看此页面时,只有原始页面的左上角部分应该填充整个页面。我该怎么做?如何使网页兼容移动浏览器。

I have created an html page for login containing fields for username and password on top left corner of page. I want then when this page is viewed in Android emulator browser, only the top left part of my original page should be filling the entire page. How should I do this? How to make a webpage compatible to mobile browser.

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

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

发布评论

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

评论(2

り繁华旳梦境 2024-10-11 06:44:19

将宽度和高度设置为 100% 可能会解决您的问题,但很难猜测。

在此处发布代码的相关部分,这样人们就可以更轻松地提供帮助。

Setting the width and height to 100% might solve your problem, but it's difficult to guess.

Post the relevant part of your code here, then people can help easier.

与君绝 2024-10-11 06:44:19

您可以使用下面的 JavaScript 代码来检测浏览器并使用 setAttribute() 即时更改 html 元素的属性。解释如下:
http://www.javascriptkit.com/dhtmltutors/domattribute.shtml


if((navigator.userAgent.match(/Android/i))  { 
        ...
}

You can use the javascript code below to detect browser and change the properties of html elements using setAttribute() on the fly. It is explained here:
http://www.javascriptkit.com/dhtmltutors/domattribute.shtml


if((navigator.userAgent.match(/Android/i))  { 
        ...
}

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