2016-12-03 156 views
0

我正试图在state street网站的图片(曲线背景图片)中实现类似的效果,但是在CSS中。在CSS中的曲线背景图像

2009年,由于计算器从其他用户的帖子,我已经能够创造一些使用边界半径有几分相似,看到http://jsfiddle.net/dg44thbr/9/

的问题是,我的曲线......太曲折。我希望它像州道一样更“直”。

在CSS中可能吗?

感谢,

enter image description here

body { 
    margin: 0; 
    background: red; 
} 

div#back { 
    position: relative; 
    height: 200px; 
    background-image: url(http://wearepeak.co.uk/wp-content/uploads/2016/02/testimonial.jpg); 
    width: 100%; 
    border-bottom-left-radius: 70% 60px; 
    border-bottom-right-radius: 30% 10px; 
} 

回答

1

好了,你可以试试这个关于大小:http://jsfiddle.net/dg44thbr/10/

body { 
 
    margin: 0; 
 
    background: red; 
 
} 
 

 
div#back { 
 
    position: relative; 
 
    height: 100px; 
 
    background-image: url(http://wearepeak.co.uk/wp-content/uploads/2016/02/testimonial.jpg); 
 
    width: 100%; 
 
    border-bottom-left-radius: 250% 160px; 
 
    border-bottom-right-radius: 0; 
 
    margin-left: -2em; 
 
    padding-right: 2em; 
 
}
<div id="back"></div>

+0

感谢。几乎我在找1 :)有没有办法让曲线的末端(左侧)更直? – Greg

+0

我更新了一下代码,现在看看? – junkfoodjunkie

+0

完美,非常感谢您的帮助! – Greg