在 IE6/IE7 中,對 `
button, input[type="button"], input[type="submit"], input[type="reset"] {
border: 0 none; /* 同時設定 width=0、style=none */
/* 或分開寫 */
border-width: 0;
border-style: none;
}
明確將寬度歸零,消除 IE 保留的預設寬度。
button {
background: #fff; /* 任何具體顏色值 */
}
/* Normalize.css 片段 */
button,
input,
select,
textarea {
border: 0; /* 統一歸零 */
background: none; /* 移除預設背景 */
font: inherit; /* 繼承字體 */
margin: 0; * 移除預設邊距 */
}
引入成熟的 Reset/Normalize 樣式表可一次解決跨瀏覽器表單元素一致性問題。
IE6/7 對 `border: none` 的不完整解析是歷史遺留 Bug。使用 `border: 0 none` 明確重置寬度與樣式,或搭配背景色觸發 `hasLayout`,即可修正。新專案建議直接採用 Normalize.css,避免逐個元素修補。