站内搜索:
首页 >> 前端 >> 内容
CSS3之线条特效(鼠标悬停线条从中间变长)

时间:2017/1/20 9:53:18

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

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

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

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>
        <p id="wrap">
            <p class="good">福</p>
            <p id="line"></p>
        </p>
     </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;
}

  • 上一篇:全角半角&&6种空白空格的区别
  • 下一篇:Boostrap的响应式布局
  • 返回顶部