开发者

Firefox specific margin? [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 11 years ago.

How can I set a specific margin for Firefox in CSS? I tried -moz-margin:0px;

My problem is in every browser, even IE works,

but firefox f开发者_运维问答ails at my CSS now... There are certain links that move like 1px to the left when I rollover them...


Your problem probably lies elsewhere, but here's how you target Firefox only:

@-moz-document url-prefix() {
    a {
        margin: 0;
    }
}


You can try something like this:

@-moz-document url-prefix() { //Your css here }

That will only be read by Firefox.

Source


To directly answer your question:

.myElement, x:-moz-any-link, x:default {
    margin: 0px;
}

This will set all elements with the 'myElement' class to a 0px margin within firefox only.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜