流体布局中的 CSS Sprite

发布于 2024-12-10 09:40:35 字数 207 浏览 0 评论 0原文

我有一个用于 CSS sprite 的背景图像

在此处输入图像描述

现在的问题是我只能使用流体布局 (只有%,没有px)并且%定位在调整浏览器大小时会产生问题(例如显示其他箭头的某些部分)

如何解决此问题?我可以获得如何使用 % 定位作为背景的示例吗?

I have a background image to be used for CSS sprite

enter image description here

Now the issue is I can only use fluid layout (only %, no px) and the % positioning creates an issue while resizing the browser (e.g. some portion of other arrow gets displayed)

How do I fix this ? Can i get an example of how to use % positioning for background ?

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

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

发布评论

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

评论(1

金兰素衣 2024-12-17 09:40:35

流动布局和使用固定定位并不相互排斥。

如果页面上有一个不展开的元素,例如使用精灵背景的按钮,则使用 px 来确定大小或位置是合适的(可以说是强制的)。

A fluid layout and using fixed positioning are not mutually exclusive.

If you have an element on the page that does not expand, for example a button using a sprite background, then using px for size or position is appropriate (arguably mandatory).

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