如何使用 CSS 设置圆形按钮的样式?
cssweb developmentfront end technology更新于 2025/10/5 9:16:17
以下是使用 CSS 设置圆形按钮样式的代码 −
示例
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
a {
text-decoration: none;
display: inline-block;
padding: 18px;
font-size: 35px;
width: 60px;
height: 60px;
text-align: center;
}
.btn1:hover {
background-color: #ddd;
color: black;
}
.btn2:hover {
background-color: rgb(121, 37, 133);
color: white;
}
.btn1 {
border-radius: 50%;
background-color: #acacac;
color: black;
}
.btn2 {
border-radius: 50%;
background-color: rgb(68, 30, 112);
color: white;
}
</style>
</head>
<body>
<h1>Style round Button Example</h1>href="#" class="btn1">50%</a>
<a href="#" class="btn2">50%</a>
</body>
</html>
输出
上述代码将产生以下输出 −

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

