在学习css的时候,写出来一个CSS缎带效果,感觉还不错,下面小编就来带你们了解一下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | <!DOCTYPE HTML>
<html>
<head>
<style type= "text/css" >
.ribbon-content {
border: 1px solid #DDD;
font-weight: bold;
margin: 0 -10px;
min-height: 30px;
padding: 7px 31px;
text-align: center;
line-height: 30px;
}
.ribbon-left {
display: block;
border-left: 10px solid white;
border-top: 8px solid #EEE;
float: left;
height: 0;
margin-left: -10px;
width: 0;
}
.ribbon-right {
display: block;
border-right: 10px solid white;
border-top: 8px solid #EEE;
float: right;
height: 0;
margin-right: -10px;
width: 0;
}
</style>
</head>
<body>
<p style= "margin: 0 auto; width: 200px;" >
<p class = "ribbon" style= "background: whiteSmoke;" >
<p class = "ribbon-content" style= "background: whiteSmoke;" >标题</p>
<p class = "ribbon-left" ></p>
<p class = "ribbon-right" ></p>
</p>
<p style= "background: whiteSmoke;" >内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容</p>
</p>
</body>
</html>
|
Salin selepas log masuk
2. [图片] 捕获.JPG

Atas ialah kandungan terperinci 一个用CSS实现的缎带效果代码. Untuk maklumat lanjut, sila ikut artikel berkaitan lain di laman web China PHP!