Home  >  Article  >  Web Front-end  >  CSS中hover改变子元素和其它元素样式_html/css_WEB-ITnose

CSS中hover改变子元素和其它元素样式_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:37:581003browse

+表示下一级元素,>表示子元素

<pre name="code" class="n">    <meta charset="UTF-8">    <title></title><style>    #a {color : #FFFF00;}    #a:hover + #c{color : #00FF00;}    #a:hover + #c > #b{color : #0000FF;}</style><div id="a">元素1</div><div id="c">元素3    <div id="b">元素2</div>
</div>



版权声明:本文为博主原创文章,未经博主允许不得转载。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn