css實現分割線

來源:互聯網
上載者:User

標籤:charset   class   set   let   margin   add   div   block   dem   

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<style>
.demo {
width: 600px;
}

.line_01 {
padding: 0 20px 0;
margin: 20px 0;
line-height: 1px;
border-left: 200px solid #ddd;
border-right: 200px solid #ddd;
text-align: center;
}

.line_02 {
height: 1px;
border-top: 1px solid #ddd;
text-align: center;
}

.line_02 span {
position: relative;
top: -12px;
background: #fff;
padding: 0 20px;
}

.line_03 {
width: 600px;
}

.line_03 b {
background: #ddd;
margin-top: 4px;
display: inline-block;
width: 180px;
height: 1px;
_overflow: hidden;
vertical-align: middle;
}

.line_03 span {
display: inline-block;
width: 220px;
vertical-align: middle;
text-align: center;
}

.line_04 {
width: 600px;
}

.line_04 {
overflow: hidden;
_zoom: 1;
}

.line_04 b {
background: #ddd;
margin-top: 12px;
float: left;
width: 26%;
height: 1px;
_overflow: hidden;
}

.line_04 span {
padding: 0 10px;
width: 32%;
float: left;
text-align: center;
}

.line_05 {
letter-spacing: -1px;
color: #ddd;
}

.line_05 span {
letter-spacing: 0;
color: #222;
margin: 0 20px;
}
</style>

<div class="demo-container demo">
<div class="line_01">小小分隔線單標籤實現</div>
<br>
<br>
<div class="line_02"><span>小小分隔線 巧用色實現</span></div>
<br>
<br>
<div class="line_03"><b></b><span>小小分隔線 inline-block實現</span><b></b></div>
<br>
<br>
<div class="line_04"><b></b><span>小小分隔線 浮動來實現</span><b></b></div>
<br>
<br>
<div class="line_05">———————————<span>小小分隔線 字元來實現</span>————————————</div>
<br>
<br>
</div>

</body>
</html>

css實現分割線

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.