在学习css的时候,写出来一个css缎带效果,感觉还不错,下面小编就来带你们了解一下
<!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>
2. [图片] 捕获.jpg
以上就是一个用css实现的缎带效果代码的详细内容。