-webkit-padding-start:40px; IE和Firefox应该是什么? [英] -webkit-padding-start: 40px; What it should be for IE and Firefox?

查看:951
本文介绍了-webkit-padding-start:40px; IE和Firefox应该是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

推荐答案

对于Firefox,属性名称为 -moz-padding-start 。对于IE,没有对应的(至今)。

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

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

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:

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

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

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).

这篇关于-webkit-padding-start:40px; IE和Firefox应该是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆