2016-09-24 59 views
3

我需要帮助创建边缘CSS3衰落/ HTML5像图像curved lineHTML/CSS3 - 曲线

我一直在寻找这个例子from codepen但边缘不褪色

.box{ 
    width:500px; height:100px; 
    border:solid 5px #000; 
    border-color:#000 transparent transparent transparent; 
    border-radius: 50%/100px 100px 0 0; 
} 
<div class="box"></div> 
曲线

可以做到吗?

回答

1

只要复制粘贴您HTML

.box{ 
 
\t width: 400px; 
 
\t height: 200px; 
 
\t background: #F98821; 
 
\t -moz-border-radius: 200px/91px; 
 
\t -webkit-border-radius: 200px/91px; 
 
\t border-radius: 200px/91px; \t 
 
} 
 

 
.box:before { 
 
\t content: ''; 
 
\t width: 400px; 
 
\t height: 200px; 
 
\t background: #fff; 
 
\t -moz-border-radius: 193px/70px; 
 
\t -webkit-border-radius: 193px/70px; 
 
\t border-radius: 193px/70px; 
 
\t top:13px; 
 
\t position: absolute; 
 
}
<div class="box"></div>

+0

哇,这是真棒!你是个天才。谢谢。 – stig

+0

非常感谢@ @ st欢迎 –

0

Reference

.box{ 
 
\t width: 400px; 
 
\t height: 200px; 
 
\t background: orange; 
 
\t -moz-border-radius: 200px/100px; 
 
\t -webkit-border-radius: 200px/100px; 
 
\t border-radius: 200px/100px; \t 
 
} 
 

 
.box:after { 
 
\t content: ''; 
 
\t width: 400px; 
 
\t height: 200px; 
 
\t background: #fff; 
 
\t -moz-border-radius: 200px/100px; 
 
\t -webkit-border-radius: 200px/100px; 
 
\t border-radius: 200px/100px; 
 

 
\t top:13px; 
 
\t position: absolute; 
 
}
<div class="box"></div>

1

使用视窗单位是最好的响应

.holi { 
 
    border-top: orange solid 5px; 
 
    width: 50vw; 
 
    margin: 0 auto; 
 
    height: 14vh; 
 
    border-radius: 25vw/7vh; 
 
}
<div class="holi"> 
 
</div>

+0

这个很好。谢谢! – stig