标题:助你美化网站的实用css3技巧(3)
只看楼主
elsyyzh
Rank: 1
来 自:湖北黄冈
等 级:新手上路
帖 子:29
专家分:0
注 册:2015-11-9
结帖率:0
 问题点数:0 回复次数:1 
助你美化网站的实用css3技巧(3)
圆角丝带效果

这段代码有点长,但是圆角丝带效果很奇特!

HTML:
<div class="wrapper">
       <div class="ribbon-wrapper-green"><div class="ribbon-green">NEWS</div></div>
</div>

CSS:
程序代码:
.wrapper {
  margin: 50px auto;
  width: 280px;
  height: 370px;
  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;
}
  
.ribbon-wrapper-green {
  width:85px;
  height:88px;
  overflow:hidden;
  position:absolute;
  top: -3px;
  right: -3px;
}
  
.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);
}
  
.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;
}
  
.ribbon-green:before {
  left: 0;
}
.ribbon-green:after {
  right: 0;
}
搜索更多相关主题的帖子: color 技巧 网站 
2015-12-03 15:27



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-459848-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.091844 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved