zoukankan      html  css  js  c++  java
  • Demo—标题左右两侧的对等横线

    <!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: "";
    			 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>
    

      

  • 相关阅读:
    547. Friend Circles
    399. Evaluate Division
    684. Redundant Connection
    327. Count of Range Sum
    LeetCode 130 被围绕的区域
    LeetCode 696 计数二进制子串
    LeetCode 116 填充每个节点的下一个右侧节点
    LeetCode 101 对称二叉树
    LeetCode 111 二叉树最小深度
    LeetCode 59 螺旋矩阵II
  • 原文地址:https://www.cnblogs.com/witkeydu/p/8376654.html
Copyright © 2011-2022 走看看