css之斜线

http://www.cnblogs.com/newsea/p/3781110.html
.x { border: solid 1px red; width: 100px; height: 100px; position: relative; background-color: transparent; } .x:before { position: absolute; top: 0px; right: 0; left: 0; bottom: 0; border-bottom: 100px solid red; border-left: 100px solid transparent; content: ""; } .x:after { position: absolute; left: 1px; right: 0; top: 1px; bottom: 0; border-bottom: 99px solid white; border-left: 99px solid transparent; content: ""; } .f { border: solid 1px red; width: 100px; height: 100px; position: relative; background-color: transparent; } .f:before { position: absolute; top: 0px; right: 0; left: 0; bottom: 0; border-bottom: 100px solid red; border-right: 100px solid transparent; content: ""; } .f:after { position: absolute; left: 0; right: 1px; top: 1px; bottom: 0; border-bottom: 99px solid white; border-right: 99px solid transparent; content: ""; }
复制代码

 

x 是 斜线, f 是反斜线。

图:

转载于:https://www.cnblogs.com/nc-blog/p/4381422.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值