css实现随鼠标移动div渐变色效果
css实现随鼠标移动div渐变色效果
发布时间:2016-12-27 来源:查字典编辑
摘要:HTMLCSSbody{background:#ecf0f1;}.art{width:400px;margin:0pxauto;}.box{...

HTML

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

CSS

body{

background:#ecf0f1;

}</p> <p>.art{

width:400px;

margin:0px auto;

}</p> <p>.box{

border-radius:30%;

width:200px;

height:200px;

border:1px solid #2c3e50;

padding:10px;

opacity:0.97;

}</p> <p>.lvl1{

text-align:center;

line-height:200px;

}</p> <p>.lvl1:hover{ background:#f1c40f;}

.lvl2:hover{ background:#f39c12;}

.lvl3:hover{ background:#e67e22;}

.lvl4:hover{ background:#d35400;}

.lvl5:hover{ background:#e74c3c;}

.lvl6:hover{ background:#c0392b;}

大家可运行一下代码就可以看到效果了

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新 Div+Css教程学习
热门 Div+Css教程学习
网页设计子分类