css::first-child设置首个子对象的样式

时间:2026-02-15 04:25:00

1、新建HTML文件

css::first-child设置首个子对象的样式

2、创建p和ul ,li标签

css::first-child设置首个子对象的样式

3、预览效果如图

css::first-child设置首个子对象的样式

4、设置p元素的首个对象样式p:first-child { font-size:40px;}

css::first-child设置首个子对象的样式

5、预览效果如图

css::first-child设置首个子对象的样式

6、设置li元素的首个对象样式li:first-child { text-decoration:line-through;}

css::first-child设置首个子对象的样式

7、预览效果如图

css::first-child设置首个子对象的样式

© 2026 乐乐经验网
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com