流体布局中的 CSS Sprite
我有一个用于 CSS sprite 的背景图像
现在的问题是我只能使用流体布局 (只有%,没有px)并且%定位在调整浏览器大小时会产生问题(例如显示其他箭头的某些部分)
如何解决此问题?我可以获得如何使用 % 定位作为背景的示例吗?
I have a background image to be used for CSS sprite
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
更多
发布评论
评论(1)
流动布局和使用固定定位并不相互排斥。
如果页面上有一个不展开的元素,例如使用精灵背景的按钮,则使用
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).