缩放 Web 前端

发布于 2024-09-03 12:46:23 字数 390 浏览 9 评论 0原文

我有一个最初设计用于电视的网页布局(从具有模糊浏览器的设备运行)。我们检测电视的分辨率,然后提供相应的 css 文件和图像。这些 CSS 工作表和图像已专门针对我们支持的三种分辨率(576、720 和 1080)进行了缩放。

现在,我的一项令人愉快的任务是尝试使其与您的标准浏览器(IE、FF、Chrome)一起使用。我只是想知道如何缩放到 PC 分辨率(1024x768)才能使其在这些浏览器中运行。我没有用于此任务的单独 css 表和图像,所以我想我要么必须使用一些 javascript 动态缩放默认 css 表,要么利用浏览器的缩放功能(ctrl+/ctrl-)。后一个建议被忽视了,所以我想我必须以其他方式做到这一点。

问题是,图像是精灵,它们都是背景图像,所以我不知道缩放它们是否有效。

有人有什么建议吗?

I have a web layout originally designed for use with televisions (running from a device with an obscure browser). We detect which resolution the tv is then serve up the corresponding css file and images. These css sheets and images have been scaled specifically for the three resolutions we support - 576, 720 and 1080.

Now I have the joyous task of trying to get this to work with your standard browsers - IE, FF, Chrome. I am just wondering how I go about scaling to PC resolution (1024x768) in order for this to work in these browsers. I don't have a separate css sheet and images for this task, so I think I either have to scale the default css sheet on the fly with some javascript, or maybe take advantage of the browser's zoom (ctrl+/ctrl-). The latter suggestion was shrugged off so I think I have to so this some other way.

The problem is, is that the images are sprites and they are all background images so I don't know if scaling them would work.

Does anyone have any suggestions?

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

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

发布评论

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

评论(2

长途伴 2024-09-10 12:46:23

使用 JavaScript 重新缩放页面(可能)比仅编写新的 CSS 需要更长的时间。 “PC 分辨率”不仅仅是 1024x768,您应该假设它是流动的。

我的建议。包含现有样式表之一,然后创建一个包含在其后的新样式表,覆盖您需要的部分。 Firefox + Firebug 可能会在这里为您提供帮助,或者使用 Web Inspector 的 Chrome/Safari。

尽管这超出了您最初的问题,但我想说,尝试盲目地将基于电视的菜单(我认为是用遥控器操作的)移植到网络上可能是一个坏主意,您的时间可能最好花在为网络重建它上,而不仅仅是试图使其适合屏幕。

It would (probably) take longer to re-scale the page with JavaScript than it would to just write new CSS. "PC Resolution" is not simply 1024x768, you should assume that it's fluid.

My suggestion. Include one of your existing stylesheets, then create a new stylesheet that you include after it, overriding the parts you need to. Firefox + Firebug might help you here, or Chrome/Safari using the Web Inspector.

Although it's beyond your original question, I would say that trying to blindly port a TV based menu (that I assume was operated with a remote control) to the web is maybe a bad idea and your time might be better spent rebuilding it for the web, not simply trying to make it fit on the screen.

雾里花 2024-09-10 12:46:23

您确定需要填满整个屏幕吗?许多人将浏览器窗口设置得小于最大尺寸。

Are you sure you need to fill the whole screen? Many people keep their browser window smaller than maximum size.

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