CSS 定位问题 - 右侧位置间歇性地起作用
我有一个真正困扰我的问题:我编写了一些在大多数情况下都可以正常工作(正如我所期望的)的 css,但有时却无法正常工作。再进一步看,似乎并不是每次都显示正确的属性。这是代码:
input.search-lupe {
position: relative;
top: 318px;
right: -915px;
background: url(../images/lupe.png) no-repeat;
width: 22; height: 23; border: 0;
padding: 0 38px 0 10px;
z-index: 201; }
就像我说的,大多数时候,它可以正常工作,但有时却不能,我可以看到这是因为每次都没有显示正确的属性。我觉得这很奇怪。回顾一下,当元素显示错误时,我检查了 Firebug 中的代码,这就是我所看到的:
input.search-lupe {
position: relative;
top: 318px;
background: url(../images/lupe.png) no-repeat;
width: 22; height: 23; border: 0;
padding: 0 38px 0 10px;
z-index: 201; }
该问题发生在同一浏览器中(Firefox 7、Mac 有时有效,有时无效。Safari 5 Mac 也是如此) 。有什么想法吗?
I've got an issue that is really bugging me: I wrote some css that works fine (as I expected) most of the time, however intermittently it doesn't. Looking further, it seems that the right property is not displayed every time. Here's the code:
input.search-lupe {
position: relative;
top: 318px;
right: -915px;
background: url(../images/lupe.png) no-repeat;
width: 22; height: 23; border: 0;
padding: 0 38px 0 10px;
z-index: 201; }
Like I said, most of the time, it works as it should, however sometimes it doesn't and I can see that it is because of the right property is not being displayed every time. It seems very odd to me. Just to recap, when the element is displayed wrongly, I check the code in Firebug and that's what I see:
input.search-lupe {
position: relative;
top: 318px;
background: url(../images/lupe.png) no-repeat;
width: 22; height: 23; border: 0;
padding: 0 38px 0 10px;
z-index: 201; }
The issue happens in the same browser (Firefox 7, Mac sometime works, sometimes doesn't. The same with Safari 5 Mac). Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许这不是你的问题,但你不应该在
width: 22; 之后添加
?px
高度:23;Maybe it's not your problem but shouldn't you add
px
afterwidth: 22; height: 23;
?