Ruby's Louvre

每天学习一点点算法

导航

css斜线

斜线
     <div class="demo">
          <div class="inner">
             斜线
         </div>
    </div>
.demo{
  display: inline-block;
  width: 400px;
  height: 100px;
  resize: both;
  overflow: auto;
  margin-top: 30px;
  

      background: -webkit-gradient(linear, 100% 0, 0 100%, color-stop(49.9%, transparent), color-stop(49.9%, green), color-stop(50.1%, green), color-stop(50.1%, transparent));
    background: -webkit-linear-gradient(to top right, transparent 49.9%, green 49.9%, green 50.1%, transparent 50.1%);
    background: -moz-linear-gradient(to top right, transparent 49.9%, green 49.9%, green 50.1%, transparent 50.1%);
    background: -o-linear-gradient(to top right, transparent 49.9%, green 49.9%, green 50.1%, transparent 50.1%);
    background: linear-gradient(to top right, transparent 49.9%, green 49.9%, green 50.1%, transparent 50.1%);
  background-repeat: no-repeat;

  border:1px solid #999;
}

如果不支持,可见这里

     <div class="demo">
        <div class="innert">斜线</div>
    </div>
.demo2{
   border-corner-shape: bevel;
   border-radius: 0px 100% 0px 100.6%;
   border:1px solid red;
   width:200px;
   height:100px;
}



posted on 2013-10-29 11:57  司徒正美  阅读(3072)  评论(0编辑  收藏  举报