在学习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>
以上就是一个用CSS实现的缎带效果代码的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号