频道栏目
首页 > 资讯 > HTML/CSS > 正文

CSS3之线条特效(鼠标悬停线条从中间变长)

17-01-20        来源:[db:作者]  
收藏   我要投稿

CSS3之线条特效(鼠标悬停线条从中间变长)

这里写图片描述

当鼠标悬停在红色圆上时,福字下面出现一条白色的线条从中间不断向两边延伸

这里写图片描述
<!doctype html>
<html>
     <head>
            <meta charset="UTF-8">
            <meta name="Generator" content="EditPlus®">
            <meta name="Author" content="">
            <meta name="Keywords" content="">
            <meta name="Description" content="">
            <title>Document</title>
     </head>
     <body>
        <div id="wrap">
            <p class="good">福</p>
            <div id="line"></div>
        </div>
     </body>
</html>
#wrap {
	width: 500px;
	height: 500px;
	border-radius: 50%;
	background-color: #E4393C;
	margin: 100px auto;
	position: relative;
}

#wrap:befor {
	content: "";
	display: table;
}

p.good {
	float: left;
	font-size: 168px;
	font-family: "楷体";
	color: #fff;
	margin: 148px 0 0 166px;
}

#line {
	width: 0px;
	height: 5px;
	border-radius: 5px;
	background-color: #fff;
	margin: 0 auto;
	position: absolute;
	top: 338px;
	left: 0px;
	right: 0px;
	transition: width 1s linear;
}

#wrap:hover #line {
	width: 200px;
}
相关TAG标签
上一篇:jquery的ajax和getJson跨域获取json数据
下一篇:SpringBoot(五)定时器
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站