Result Size: 625 x 534
x
 
<!DOCTYPE html>
<html>
<head>
<style>
.button {
  background-color: #4CAF50; /* Green */
  border: none;
  color: white;
  padding: 15px 32px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;
}
.button1 {width: 250px;}
.button2 {width: 50%;}
.button3 {width: 100%;}
</style>
</head>
<body>
<h2>按钮宽度</h2>
<p>使用 width 属性改变按钮的宽度:</p>
<p><strong>提示</strong>:如果您想设置固定宽度,请使用像素,并为响应式按钮使用百分比(例如,其父元素的 50%)。 调整浏览器窗口大小以查看效果。</p>
<button class="button button1">250px</button><br>
<button class="button button2">50%</button><br>
<button class="button button3">100%</button>
</body>
</html>