站长技术网

首页 > 网站基础 > DIV&CSS >

css后代选择器使用方法实例

点评:下面是一个css后代选择器的例子,感兴趣的朋友可以参考下,希望对大家有帮助!

复制代码代码如下:

<style>

.father .child1,.child2{

border:1px solid red;maring:5px;

}

</style>

<p class="father">

没有边框

<p class="child1">有边框 <a href="<a href="http://keleyi.com/a/bjac/wfxui1oc.htm">http://keleyi.com/a/bjac/wfxui1oc.htm</a>">本文</a>

<p class="child2">有边框 <a href="<a href="http://keleyi.com/a/bjac/wfxui1oc.htm">http://keleyi.com/a/bjac/wfxui1oc.htm</a>">本文</a>