2016-04-21 37 views
0

我想像弯曲的形状一样弯曲div的角落!塑造div的角落

我尝试边界半径,但它过多的角落形状。 是否有任何css3属性来实现结果?

这是我现在已经

enter image description here

得到这个就是我想要它看起来像..

enter image description here

HTML:

<body> 
    <div class="who_we_are_bg"> 
    <div class="container"> 
    <div class="content"> 

<div class="who_we_are_content"> 
<img src="images/who-we-are.jpg" alt="LCK chemicals"/> 
<div class="corner1"></div> 
<div class="corner2"></div> 
<div class="corner3"></div> 
<div class="corner4"></div> 
<h2>WHO WE WRE</h2> 
<p>SRI LCK Chemical founded in 2010 has exceptional sourcing ability for chemicals used in Industrial and House keep segments. We strive to develop quality products and outstanding customer service.</p> 
<p>SRI LCK Chemical founded in 2010 has exceptional sourcing ability for chemicals used in Industrial and House keep segments. We strive to develop quality products and outstanding customer service.</p> 
<a href="#">more info</a> 

    </div> 
</div> 
    </div> 
</div> 

</body> 

css:

.container{max-width:1170px;margin:0 auto;border:1px solid red;} 
    .who_we_are_bg{width:100%;float:left;background:url("images/texture2.jpg")repeat 0 0;} 
.who_we_are_content {float: none;margin: 0 auto;width: 90%;padding:50px 0 80px;overflow:hidden;} 
.who_we_are_content img{margin:8px 40px 20px 0;padding:10px;background:#fff;position:relative;} 
.corner1{position:absolute;width:50px;height:10px; box-shadow: 0px 0px 10px black;z-index:-1;} 
.who_we_are_content h2{font-family: 'OpenSans-Bold';font-size:30px;margin:10px 0 10px;} 
.who_we_are_content p{padding-bottom:10px;font-family: 'OpenSansSemibold';} 
.who_we_are_content a{font-family: 'OpenSansSemibold';text-decoration:none;float:left;padding:10px;background:#98b769;color:#fff;} 
+0

http://stackoverflow.com/questions/16388078/is-a-concave-border-radius-possible – Pogrindis

+0

你需要一个半边框还是什么? –

+0

是的人像图中所示 – Nag

回答

0

您可以在背景上使用径向渐变渲染凹面边框。例如,像这样:

#test { 
    width: 200px; 
    height: 200px; 
    background: #888888; 
    background: 
     radial-gradient(circle 20px at -20% 50%,transparent,transparent 100px,#888888 100px), 
     radial-gradient(circle 20px at 120% 50%,transparent,transparent 100px,#888888 100px); 
    background-size:100px 200px, 100px 200px; 
    background-position:0 0,100% 0; 
    background-repeat:no-repeat; 
} 

注意,大多数WebKit浏览器仍然需要为径向渐变的前缀,如果你想充分支持你可能需要执行旧的梯度语法太旧的浏览器。

从这里简称:https://stackoverflow.com/a/16388187/4119808

+0

它给圆角的边缘!但我希望边缘平直,中间有小突起,如图所示 – Nag