html - -webkit-填充-开始 : 40px; What it should be for IE and Firefox?

标签 html css cross-browser

-webkit-padding-start: 40px; 适用于 Chrome

IEFirefox 有什么用?

最佳答案

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

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

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

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

关于html - -webkit-填充-开始 : 40px; What it should be for IE and Firefox?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12549591/

相关文章:

html - 在 ASP.NET MVC5 中拉伸(stretch)表单中的文本框

css - Chrome 没有检测到 Bootstrap 轮播的自动高度

javascript - Handlebars 自定义助手错误 : "options.fn is not a function"

html - 如何创建一个与某些其他 div 重叠的列/div 以具有粘性侧边栏但仍保留其他 div 的背景颜色?

javascript - 如何跨浏览器跨平台获取窗口的有效高度?

cross-browser - 现在如何为多个浏览器开发站点?

testing - 移动跨浏览器网络测试

javascript - 新的固定位置 div 创建后滚动条不显示

javascript - 在单个页面上添加多个 bootstrap 4 轮播

css - 将噪声图像混合到 CSS 按钮中的目的是什么?