css实现div边框圆角渐变色


div添加渐变色后, 圆角失效。所以用伪元素来实现同时圆角渐变色:

.main{
width: 400px;
height: 600px;
margin
: 0rem 1rem; padding: 0.5rem 0rem; text-align: center; background: #e8eced; border-radius: 0rem 0.4rem 0.4rem 0rem; } .main:after{ content:''; position: absolute; top: 0rem; bottom: 0rem; left: 0.6rem; right: 1rem; background: -webkit-linear-gradient(to bottom,#5fb3fc, #46a1f4); background: -moz-linear-gradient(to bottom,#5fb3fc, #46a1f4); background: linear-gradient(to bottom,#5fb3fc, #46a1f4); border-radius: 0.4rem 0.5rem 0.5rem 0.4rem; content: ''; z-index: -1; }
<div class="main"></div>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM