← 全部工具

CSS 按鈕產生器

設定按鈕樣式,實測一般、懸停與鍵盤焦點狀態。

css-button-generator本機處理

正在啟用本機工具…

工具設定

設定只留在本頁。重新載入後會恢復預設值。

功能參考查閱日期 2026-11-21 · ZeroServer

即時預覽與匯出

CSS

.custom-button {
  background: #4f46e5;
  color: #ffffff;
  padding: 11px 22px;
  border: 0px solid #000000;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  max-inline-size: 100%;
  overflow-wrap: anywhere;
}

.custom-button:hover, .custom-button:focus-visible {
  background: #4338ca;
}

.custom-button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -4px;
}

@media (prefers-reduced-motion: no-preference) {
  .custom-button {
    transition: background-color 0.2s ease;
  }
}

HTML

<button class="custom-button" type="button">點一下</button>

如何使用這個工具

選擇預設或修改設定,查看即時預覽,再複製或下載樣式,以及可用的標記。

不適合用在什麼情況

請在實際使用匯出樣式的元件驗證色彩對比、位置及瀏覽器行為。