简体   繁体   English

弯曲的盒子变成CSS?

[英]Curved box into css?

可以仅使用CSS或至少90%带有角件的CSS来创建此框 ,还是最好重新设计它?

.panel {
    background-color: #2B2B2B;
    -webkit-border-radius: 10px; /* CSS3 Property for webkit design engine used browser */
    -moz-border-radius: 10px; /* CSS3 Property for Mozilla */
    -o-border-radius: 10px; /* CSS3 Property for Opera */
    border-radius: 10px; /* CSS3 Property for Modern Browsers */
    padding: 25px;
}

You can simply use CSS3: 您可以简单地使用CSS3:

div{
    border-radius: 5px; /* 5px rounded corner on all corners */
}

If you want to use a more browser-support friendly method, you can use background images, or a method like that that Spiffy Corners provides, using small divs to recreate the effect. 如果要使用浏览器支持更友好的方法,则可以使用背景图像或Spiffy Corners提供的类似方法,并使用较小的div来重新创建效果。

It is very possible, see here 很有可能,请看这里

however if you decide to use corner pieces for compatability you can jsut use: 但是,如果决定使用角码来实现兼容性,则可以使用:

<div id="box">
<div style="clear:both;">
  <div id="topleft" style="float: left;"></div><div></div><div id="topright" style="float: right;"></div>
</div>
<div id="content"></div>
<div style="clear:both;">
  <div id="bottomleft" style="float: left;"></div><div></div><div id="bottomright" style="float: right;"></div>
</div>
</div>

entirely with css. 完全与CSS。 not exact, but very similar http://jsfiddle.net/jalbertbowdenii/EBfbZ/ 不精确,但非常相似http://jsfiddle.net/jalbertbowdenii/EBfbZ/

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

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