Html -webkit-padding-start: 40px; IE 和 Firefox 应该是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12549591/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 02:59:17  来源:igfitidea点击:

-webkit-padding-start: 40px; What it should be for IE and Firefox?

htmlcsscross-browser

提问by Cheong D Mun Pong

-webkit-padding-start: 40px;for Chrome

-webkit-padding-start: 40px;

What it is for IEand Firefox?

它适用于IEFirefox吗?

采纳答案by Jukka K. Korpela

For Firefox, the property name is -moz-padding-start. For IE, there is no counterpart (so far).

对于 Firefox,属性名称是-moz-padding-start. 对于 IE,没有对应物(到目前为止)。

You can achieve the same effect using widely supported CSS features at least in a simple scenario where the page as a whole is either in left-to-right or in right-to-left layout and writing direction. Using <html dir=ltr>or <html dir=rtl>, respectively, you can write your CSS code like this:

至少在页面整体为从左到右或从右到左布局和书写方向的简单场景中,您可以使用广泛支持的 CSS 功能实现相同的效果。分别使用<html dir=ltr><html dir=rtl>,您可以像这样编写 CSS 代码:

[dir=ltr] .foo {
   padding-left: 2.5em;
}
[dir=rtl] .foo {
   padding-right: 2.5em;
}

This would correspond to .foo { padding-start: 2.5em; }. Of course, this approach means some duplication of code. But it works on almost 100% (including IE 7 and newer in Standad Mode).

这将对应于.foo { padding-start: 2.5em; }. 当然,这种方法意味着一些重复的代码。但它几乎可以 100% 运行(包括标准模式下的 IE 7 和更新版本)。

回答by earlonrails

-moz-padding-start: 40px;
-webkit-padding-start: 40px;
-khtml-padding-start: 40px;
-o-padding-start: 40px;
padding-start: 40px;
padding: 40px;

I do not believe IE has a padding-start equivalent.

我不相信 IE 有一个 padding-start 等价物。