CSS:Safari 的边距问题
在我正在工作的网站上,由于某种原因需要保证金Safari 与 FF、IE8、Chrome 和 FF 有所不同歌剧?我有一个链接,我想将其排列在标签旁边。除了 Safari 需要 12 像素的差异外,它在所有其他浏览器中都排列得很好。以下屏幕截图可以更好地描述该问题:点击
Safari 屏幕截图显示标签太低。这是我用于工作 4 浏览器的 CSS:
.submitter a {
float: right;
margin: -2px 0 0 2px;
padding: 0 !important;
}
这是适用于 Safari 的代码,但是,使用它会将链接向上 12 像素。
.submitter a {
float: right;
margin: -14px 0 0 2px; Works in Safari & Chrome
padding: 0 !important;
}
有人能解释一下吗? TIA
On the site I'm working on, for some reason the margin is needing to be different for Safari than in FF, IE8, Chrome & Opera? I have a link that I want lined up next to a label. It's lining up fine in all but Safari which needs a 12 pixel difference. Here's a screenshot to better describe the issue: Click
The Safari screenshot shows the label down too low. This is the CSS I use for the working 4 browsers:
.submitter a {
float: right;
margin: -2px 0 0 2px;
padding: 0 !important;
}
And here's the code that works for Safari, however, usig it throws the link UP 12 pixels.
.submitter a {
float: right;
margin: -14px 0 0 2px; Works in Safari & Chrome
padding: 0 !important;
}
Anyone able to shed some light on this? TIA
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
查看该网站,锚点被
.box_777 ul li a
设置为block
,然后由.submitter a
向右浮动。如果我删除
display: block;
和float: right;
,事情就会对齐。Looking at the site, the anchor is being set to
block
by.box_777 ul li a
and then floated right by.submitter a
.If I remove the
display: block;
andfloat: right;
things align.这似乎解决了这个问题:
由于级联的无意义使用,它确实非常复杂。
某些规则被应用于实际上不应该由于选择器而出现的元素,例如:
您最好用以下内容替换该选择器:
但是,很难预测改进选择器将如何改变页面的显示方式。
This seems to sort it out:
It's really very convoluted in there due to nonsensical use of the cascade.
Some rules are being applied to elements where they really shouldn't be due to selectors like:
You'd be better replacing that selector with something like:
But, it's difficult to predict how improving your selectors will change how your page displays.
它像这样上升的原因可能是由于 - 像素值。它们是否正确嵌套在 div 中?您是否对 Chrome 按钮应用了相同的对齐方式(CSS、Html 等)?
The reason it goes up like that could be because of the - pixel value. Are they nested correctly in the div? And did you apply the same alignment (CSS, Html, etc.) for the Chrome buttons?
发生了很多事情,但您可以尝试以下操作之一:(
或)
将“follow”锚标记移到“smalltext”范围之前
There is a lot going on, but you might try one of the following:
(or)
Move the "follow" anchor tag before the "smalltext" span