星空网 > 软件开发 > 网页设计

css代码中的加号(+)相邻选择器的作用

css代码中的加号(+)相邻选择器的作用:
本章节介绍一下css中相邻选择器的作用,此选择器用加号(+)表示。
此选择器能够匹配前面的选择器紧邻的兄弟元素。
代码实例:

<!DOCTYPE html><html><head><meta charset=" utf-8"><meta name="author" content="http://www.softwhy.com/" /><title>蚂蚁部落</title><style type="text/css">input[type=radio]:checked + span{ background:blue;}input[type=radio]:checked + span:after{ content:"蚂蚁部落[url=]2[/url]";}</style></head><body><form method="post"> <fieldset>  <legend>选中下面的项试试</legend>  <ul>   <li><label><input type="radio" name="colour-group"/><span>蓝色</span></label></li>   <li><label><input type="radio" name="colour-group"/><span>红色</span></label></li>   <li><label><input type="radio" name="colour-group"/><span>黑色</span></label></li>  </ul> </fieldset></form></body></html>

上面的代码演示了此选择器的作用,更多内容可以参阅相关阅读。
相关阅读:
1.相邻选择器可以参阅CSS的相邻选择符(E+F)一章节。
2.:checked伪类选择器可以参阅CSS的伪类选择符E:checked一章节。
3.:after伪元素选择器可以参阅CSS的伪对象选择符E:after/E::after一章节。

原文地址是:http://www.softwhy.com/forum.php?mod=viewthread&tid=15644

更多内容可以参阅:http://www.softwhy.com/divcss/




原标题:css代码中的加号(+)相邻选择器的作用

关键词:CSS

CSS
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

amazon美:https://www.goluckyvip.com/tag/15866.html
amazon美国fba:https://www.goluckyvip.com/tag/15867.html
amazon拿到best:https://www.goluckyvip.com/tag/15868.html
amazon培训:https://www.goluckyvip.com/tag/15869.html
征税产品:https://www.goluckyvip.com/tag/1587.html
amazon培训视频:https://www.goluckyvip.com/tag/15870.html
卓欧毕雪酒店推荐:https://www.vstour.cn/a/404237.html
响沙湾门票套票价格大介绍(省钱攻略必备):https://www.vstour.cn/a/404238.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流