[英]How to make right side in css oblique?
您还可以使用伪和转换:
a { display: inline-block;/* fallback*/ position: relative; overflow: hidden; border-radius:5px 5px 0 0; padding: 1em 3em 1em 2em; } a:before { content: ''; position: absolute; top: 0; right: 0; width: 120%; height: 200%; z-index: -1; background: tomato; border-radius:inherit; transform: skew(35deg) } nav { display: flex; margin: 1em; }
<nav><a href="#"> some link</a> <a href="#"> some link</a> <a href="#"> some link</a> </nav>
使用带有大边框的零高度 DIV:
.tab { width: 100px; height: 0px; border-right: 20px solid transparent; border-bottom: 20px solid green; }
<div class="tab"></div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.