如何创建 CSS3 圆角?
cssweb developmentfront end technology更新于 2025/12/10 21:32:17
要创建圆角,请使用 CSS3 中的 border-radius 属性。以下是创建圆角的代码 −
示例
<!DOCTYPE html>
<html>
<head>
<style>
body {
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
div {
display: inline-block;
width: 200px;
height: 200px;
text-align: center;
font-size: 30px;
}
.rounded {
border-radius: 24px;
border: 4px solid green;
}
.normal {
border: 4px solid green;
margin-left: 20px;
}
</style>
</head>
<body>
<h1>CSS3 rounded corner example</h1>
<div class="rounded">Rounded Corners</div>
<div class="normal">Default corners</div>
</body>
</html>
输出
上述代码将产生以下输出 −

相关文章
有用资源
css 参考教程 - 该教程包含有关 css 的更多信息:https://www.cainiaomax.com/css/

