CSS 特殊类,如“:-moz-placeholder”
我见过 CSS 样式如下:
input::-webkit-input-placeholder {...}
或者
input:-moz-placeholder {...}
他们向我提出了一些问题:
- 这些东西叫什么? (我在谷歌上搜索它们时遇到了麻烦。)
- 是否有一个全面的列表,其中哪些浏览器支持哪些浏览器?
- 哪些元 CSS 语言(Sass、Less、Stylus 等)支持这些(如果有)?
谢谢!
I've seen CSS styling along the following lines:
input::-webkit-input-placeholder {...}
or
input:-moz-placeholder {...}
And they raise a few questions for me:
- What are these things called? (I'm having trouble googling them.)
- Is there a comprehensive list somewhere of which ones are supported by which browsers?
- Which meta-CSS languages (Sass, Less, Stylus, etc) have support for these, if any?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
带有一个冒号的东西称为伪类,它用于处理对象的不同状态(例如:hover 和'active)。
镜头描述和列表可以在那里找到:http://reference.sitepoint.com/css/css3psuedoclasses
w3.org 上的说明: http://www.w3.org/TR/selectors/ #pseudo-classes
带有两个冒号的东西称为伪元素,它用于自动生成内容或设置部分内容的样式,例如第一行的第一个字母。
w3.org 上的说明: http://www.w3.org/TR/selectors/ #pseudo-elements
这个列表中有很多特定于浏览器的扩展。这没有记录在 css3 标准中。
您可以在这里找到 Mozilla 浏览器的列表: https://developer.mozilla.org/en/CSS_Reference/ “伪元素和伪类”部分中的 Mozilla_Extensions。
无法找到 Webkit 伪元素和类的良好列表。
The thing with one colon called pseudo-classes, it is used address different states of object (like :hover and ‘active).
Shot description and list can be found there: http://reference.sitepoint.com/css/css3psuedoclasses
Description on w3.org: http://www.w3.org/TR/selectors/#pseudo-classes
The thing with 2 colons called pseudo-elements, it is used to autogenerate content or to style part of content like first letter of first line.
Description on w3.org: http://www.w3.org/TR/selectors/#pseudo-elements
There is lot of browser-specific extensions of this list through. That didn't documented in css3 standard.
You can find list for Mozilla's browsers here: https://developer.mozilla.org/en/CSS_Reference/Mozilla_Extensions in the section "Pseudo-elements and pseudo-classes".
Can't find good list of Webkit pseudo-elements and -classes through.
它们称为供应商特定属性,通常是 CSS3 格式的供应商版本。由于 CSS3 还不是标准,从技术上讲,任何实现它们的浏览器都在实现供应商特定的扩展。
-moz 表示 Mozilla,又名 Firefox 等。
-webkit 表示基于 webkit 的浏览器,即 Safari、Chrome、Konqueror 等。
-ms
请参阅:http://reference.sitepoint.com/css/vendorspecific
They're called vendor specific properties, and they typically are a vendors version of a CSS3 format. Since CSS3 isn't a standard yet, technically any browser that implements them are implementing a vendor specific extension.
-moz mean Mozilla, aka firefox, etc..
-webkit means webkit based browsers, ie Safari, Chrome, Konqueror, etc..
-ms
See: http://reference.sitepoint.com/css/vendorspecific