HTML 和CSS - 为分辨率太低的用户创建警告消息?
我的网站目前的宽度太高,无法以 800x600 或更低的分辨率查看。我想做的是创建某种警告消息,这样当有人的分辨率这么低时,他们就会意识到该网站将无法正确查看。最好,我希望有一个黄色条从顶部下拉,就像 Internet Explorer 那样。
如何使用 HTML 和 CSS 来做到这一点?如果您不能,请告诉我如何用其他语言进行操作。
谢谢
My website currently has a width too high to be viewed at 800x600 resolution or lower. What I would like to do is to create some kind of warning message, so when someone with a resolution this low they are made aware that the site will not view properly. Preferably, I would like a yellow bar to drop down from the top much like Internet Explorer does.
How can I do this by using HTML and CSS? If you can't, please tell me how to do it in any other language.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
但请注意:旧版本的 IE 不支持媒体查询。
如果您想使用 jQuery,您可以使用以下内容:
即使在旧版本的 IE 中,这显然也可以工作。
Do note however: older versions of IE do not support media queries.
If you want to use jQuery, you can use the following:
This'll obviously work even in older versions of IE.
不要检查分辨率,而是检查视口大小。浏览器窗口可以调整大小。
使用 JavaScript 获取浏览器视口尺寸应该可以帮助您入门。如果视口太小,则输出您想要的 HTML。
Don't check for a resolution, check for a viewport size. Browser windows can be resized.
Get the browser viewport dimensions with JavaScript should get you started. Output the HTML you want if the viewport is too small.
为此,我会使用 Javascript 或 JQuery。
I would use Javascript or JQuery rather for this.