使用 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