我如何讓div修復寬度和高度到它需要的量,例如像Bootstrap那樣?爲它的按鈕..固定寬度和高度以適應CSS中的文本?
body {
background-color: #f8f9fb;
font-family: sans-serif;
}
/* Buttons... */
.button {
padding: 10px 10px;
color: #fff;
border-radius: 3px;
text-align: center;
}
.green-button {
background-color: #2cd865;
}
.green-button:hover {
background-color: #61dc7a
}
Buttons.. idk<br>
<div onclick="alert('hey');" class="button green-button">Hello World!</div>