如何制作一个 div 使其边框角为圆角?
这是:
<style type="text/css">
div.test
{
width: 115px;
padding: 10px;
border: 2px solid #000;
border-radius: 15px;
-moz-border-radius: 15px;
}
</style>
<div class="test">This is some text!</div>
添加这个CSS:
border-top-right-radius:15px;
border-top-left-radius:15px;
border-bottom-right-radius:15px;
border-bottom-left-radius:15px;
使用 CSS 添加代码:
border-radius: 10px
。
我使用 10px 为例,但您可以尝试使用您喜欢的像素数量。
如果你不想依赖像素,你可以随时使用%
border-radius: 50%;
只需使用
"border-radius"
css 属性,如下所示:
div {
border-radius:8px;
}