使用 CSS 设置按钮宽度
要设置按钮宽度,请使用 CSS width 属性。
示例
你可以尝试运行以下代码来设置按钮的宽度 −
<!DOCTYPE html>
<html>
<head>
<style>
.btn {
background-color: yellow;
color: black;
width: 120px;
text-align: center;
font-size: 15px;
padding: 20px;
border-radius: 15px;
border: 3px dashed blue;
}
</style>
</head>
<body>
<h2>Result</h2>
<p>Click below for result:</p>
<button class = "btn">Result</button>
</body>
</html>
广告
数据结构
网络
关系型数据库管理系统
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP