爲a標籤添加鼠標樣式和背景顏色

發現對a標籤設置行高,高度,寬度都只能使樣式應用到文字上,而不是本身想要的帶空白的整個區域,這個時候,可使用padding樣式爲其設置內邊距,來增大面積,從而使其樣式能充滿空白,更加好看。it

.btn a {
  text-decoration: none;
  color: white;
  padding: 15px 30px;
  background-color: #FF9800;
}io

相關文章
相關標籤/搜索