码迷,mamicode.com
首页 > 其他好文 > 详细

Demo—标题左右两侧的对等横线

时间:2018-01-29 15:53:51      阅读:151      评论:0      收藏:0      [点我收藏+]

标签:play   title   block   after   rip   charset   utf-8   meta   style   

<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>各种类型的线条</title>
	<style type="text/css">
		*{
			margin: 0;
			padding: 0;
		}
		.container{
			height: 100px;
			font-size: 24px;
			font-weight: bold;
			background: #f3f3f3;
			margin-bottom: 30px;
			text-align: center;
			line-height: 100px;
		}
		.line_one h3{
			vertical-align: middle;		
			text-align: center;
			line-height: 100px;
		}
		.line_one h3 span{
			vertical-align: middle;	
			display: inline-block;	
			padding: 0 50px;
		}
		.line_one h3:before,.line_one h3:after{
			display: inline-block;
			vertical-align: middle;
			content: "";
			width: 100px;
			height: 3px;
			background: #000000;

		}
		.line_two span{
			letter-spacing: -1px;
		}
		.line_two strong{
			padding: 0 50px;
		}
	</style>
</head>
<body>
	<div class="container line_one">
		<h3><span>世界那么大</span></h3>
	</div>
	<div class="container line_two">
		<h3>
			<span>—————————</span>
			<strong>世界那么大</strong>
			<span>—————————</span>
		</h3>
	</div>
	<div class="container line_four">
		
	</div>
	<div class="container line_five">
		
	</div>
	<div class="container line_six">
		
	</div>
	<div class="container line_seven">
		
	</div>
</body>
</html>

  

Demo—标题左右两侧的对等横线

标签:play   title   block   after   rip   charset   utf-8   meta   style   

原文地址:https://www.cnblogs.com/witkeydu/p/8376654.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!