纯CSS+CSS3右上角倾斜四十五度封页角效果

这篇博客介绍了如何使用纯CSS3实现右上角45度倾斜的封页角效果,以此减少HTTP请求,提高页面加载速度。文章通过示例代码详细展示了如何设置样式和使用transform属性进行旋转,以及利用伪元素创建三角形边框来完成封页角的形状。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

加广告与加封页脚的代码是差不多的!


以前封页脚都是图片现在只是简单的css就可以实现有效减少http请求 加快页面的的加载速度·····

<!D<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>纯CSS右上角倾斜四十五度封页角效果</title>
<!--<link rel="stylesheet" href="http://demo.lanrenzhijia.com/2016/lanren0812/css/lanren.css">-->
</head>
<style>
.lanren .ribbon-green {
font: bold 15px Sans-Serif;
color: #333;
text-align: center;
text-shadow: rgba(255,255,255,0.5) 0px 1px 0px;
/* -webkit-transform: rotate(45deg); */
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
position: relative;
padding: 7px 0;
left: -5px;
top: 15px;
width: 120px;
background-color: #BFDC7A;
background-image: -webkit-gradient(linear,left top,left bottom,from(#BFDC7A),to(#8EBF45));
background-image: -webkit-linear-gradient(top,#BFDC7A,#8EBF45);
background-image: -moz-linear-gradient(top,#BFDC7A,#8EBF45);
background-image: -ms-linear-gradient(top,#BFDC7A,#8EBF45);
background-image: -o-linear-gradient(top,#BFDC7A,#8EBF45);
color: #6a6340;
-webkit-box-shadow: 0px 0px 3px rgba(0,0,0,0.3);
-moz-box-shadow: 0px 0px 3px rgba(0,0,0,0.3);
box-shadow: 0px 0px 3px rgba(0,0,0,0.3);
}
.lanren .ribbon-green:before {
left: 0;
}
.lanren .ribbon-green:before, .ribbon-green:after {
content: "";
border-top: 3px solid #6e8900;
border-left: 3px solid transparent;
border-right: 3px solid transparent;
position: absolute;
bottom: -3px;
}

.lanren .ribbon-green:after {
right: 0;
}

.lanren .ribbon-green:before, .ribbon-green:after {
content: "";
border-top: 3px solid #6e8900;
border-left: 3px solid transparent;
border-right: 3px solid transparent;
position: absolute;
bottom: -3px;}
.lanren .ribbon-lanren-green {
width: 85px;
height: 88px;
overflow: hidden;
position: absolute;
top: -3px;
right: -3px;
}
.lanren {
margin: 50px auto;
width: 280px;
height: 180px;
background: white;
border-radius: 10px;
-webkit-box-shadow: 0px 0px 8px rgba(0,0,0,0.3);
-moz-box-shadow: 0px 0px 8px rgba(0,0,0,0.3);
box-shadow: 0px 0px 8px rgba(0,0,0,0.3);
position: relative;
z-index: 90;
}
</style>

<body>

<div class="lanren">
<div class="ribbon-lanren-green">
<div class="ribbon-green">LANREN</div>
</div>
</div>​

</body>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值