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

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

WBOY
Release: 2016-06-24 11:37:58
Original
1047 people have browsed it

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

<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>
Copy after login



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

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template