简体   繁体   English

CSS中的弯曲背景图片

[英]Curved background image in CSS

I'm trying to achieve something like in the picture below (curved background image) from state street website, but in CSS. 我正在尝试通过State Street网站实现下面的图片(弯曲的背景图片),但是使用CSS。

Thanks to posts from other users on stackoverflow, I've been able to create something a bit similar using border-radius, see http://jsfiddle.net/dg44thbr/9/ 多亏其他用户在stackoverflow上发表的文章,我才能够使用border-radius创建一些类似的东西,请参阅http://jsfiddle.net/dg44thbr/9/

The issue is that my curve... is too curvy. 问题是我的曲线...太弯曲了。 I'd like it to be more "straight" like the state street one. 我希望它更像州道上的“直”。

Is it possible in CSS? CSS可能吗?

Thanks, 谢谢,

在此处输入图片说明

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;
}

Well, you can try this one on for size: http://jsfiddle.net/dg44thbr/10/ 好吧,您可以尝试以下尺寸: 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> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM