CSS:Safari 的边距问题

发布于 2024-10-26 04:00:21 字数 689 浏览 4 评论 0原文

我正在工作的网站上,由于某种原因需要保证金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 技术交流群。

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

发布评论

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

评论(4

怪我入戏太深 2024-11-02 04:00:23

查看该网站,锚点被 .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; and float: right; things align.

荒人说梦 2024-11-02 04:00:22

这似乎解决了这个问题:

.submitter a {
    float: none;
    display: inline !important;
    margin: 0 0 0 2px;
}

由于级联的无意义使用,它确实非常复杂。

某些规则被应用于实际上不应该由于选择器而出现的元素,例如:

.box_777 ul li a

您最好用以下内容替换该选择器:

.individual-likes > a

但是,很难预测改进选择器将如何改变页面的显示方式。

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.

感性 2024-11-02 04:00:22

它像这样上升的原因可能是由于 - 像素值。它们是否正确嵌套在 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?

猫七 2024-11-02 04:00:22

发生了很多事情,但您可以尝试以下操作之一:(

.submitter .smalltext { float: left; }

或)

将“follow”锚标记移到“smalltext”范围之前

There is a lot going on, but you might try one of the following:

.submitter .smalltext { float: left; }

(or)

Move the "follow" anchor tag before the "smalltext" span

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