“Sel only of type”的版本间差异
本页内容
(创建页面,内容为“{{DISPLAYTITLE::only-of-type}}15 = CSS3 :only-of-type 选择器 = 完整CSS选择器参考手册 指定属于父元素的特定类型的唯一子元素的每个 p 元素:: <sample title="" desc="" lang="html" hererun="1"> p:only-of-type { background:#ff0000; } </sample> <run name=""> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>小白教程(xiaobai.wang)</title> <style> p:only-of-type…”) |
无编辑摘要 |
||
(未显示同一用户的1个中间版本) | |||
第1行: | 第1行: | ||
{{DISPLAYTITLE::only-of-type}}[[Category:css | {{DISPLAYTITLE::only-of-type}}[[Category:css selectors|30]] | ||
= CSS3 :only-of-type 选择器 = | = CSS3 :only-of-type 选择器 = | ||
第42行: | 第42行: | ||
{| class="table table-striped table-hover" | {| class="table table-striped table-hover" | ||
! 选择器 | ! 选择器 | ||
! | ! Chrome | ||
! | ! Internet Explorer / Edge | ||
! | ! Firefox | ||
! | ! Safari | ||
! | ! Opera | ||
|- | |- | ||
| :only-of-type | | :only-of-type |
2022年8月19日 (五) 04:50的最新版本
CSS3 :only-of-type 选择器
指定属于父元素的特定类型的唯一子元素的每个 p 元素::
示例
p:only-of-type
{
background:#ff0000;
}
定义和用法
- only-of-type 代表了任意一个元素,这个元素没有其他相同类型的兄弟元素。
浏览器支持
表格中的数字表示支持该属性的第一个浏览器版本号。
选择器 | Chrome | Internet Explorer / Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
:only-of-type | 4.0 | 9.0 | 3.5 | 3.2 | 9.6 |