CSS背景圆角

html-css01118

CSS背景圆角,第1张

给div加个样式,设置-webkit-border-radius,-moz-border-radius,border-radius,就可以实现圆角了,但是有一个问题就是IE8及一下是没有效果的

圆角主要是通过border-radius 来实现:

border-radius 属性是一个简写属性,用于设置四个 border-*-radius 属性。

提示:该属性允许为元素添加圆角边框。

简单的例子,仅供参考:

<style>

    .box {margin:100 auto width:200px height:200px position:relative}

    .shadow {width: 200px height:200px background:#ccc border-radius:10px}

    .xxx {width:150px height:150px background:red position:absolute}

</style>

<body>

    <div class="box">

        <div class="shadow"></div>

        <div class="xxx"></div>

    </div>

</body>