CSS:Safari的边距问题 [英] CSS: Margin problem with Safari
问题描述
由于某些原因,在 我正在工作的网站上 Safari的页边距需要与FF,IE8,Chrome&歌剧?我在标签旁边有一个想要排队的链接.除了需要12像素差异的Safari之外,它在所有其他产品中的排列都很好.以下是可以更好地描述问题的屏幕截图: 点击
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
Safari屏幕快照显示标签的位置太低.这是我用于4种浏览器的CSS:
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;
}
这是适用于Safari的代码,但是,usig会将链接向上抛出12个像素.
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;
}
有人能对此有所了解吗?TIA
Anyone able to shed some light on this? TIA
推荐答案
这似乎可以解决该问题:
This seems to sort it out:
.submitter a {
float: none;
display: inline !important;
margin: 0 0 0 2px;
}
由于毫无意义地使用了级联,所以它在那里确实非常复杂.
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:
.box_777 ul li a
最好用类似以下的替换该选择器:
You'd be better replacing that selector with something like:
.individual-likes > a
但是,很难预测选择器的改进将如何改变页面的显示方式.
But, it's difficult to predict how improving your selectors will change how your page displays.
这篇关于CSS:Safari的边距问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!