Skip to content

Instantly share code, notes, and snippets.

@hugojay
Created May 14, 2013 07:32
Show Gist options
  • Save hugojay/5574291 to your computer and use it in GitHub Desktop.
Save hugojay/5574291 to your computer and use it in GitHub Desktop.
因QE發現Firefox某版本中,表單項目屬性為disabled時,因頁面套了很多不知道怎麼寫的CSS(含reset.css),在其影響下會「無視」disabled應有的「反白」效果(input 的背景、文字為灰色),而呈現猶如一般表單可輸入的樣式。但在IE、Chrome上卻又有反白效果。於是乎,我寫了一段CSS來「統一」表單項目屬性為disabled的效果,讓各瀏覽器都能表達"disabled"的情形。由於IE原本就不受影響,故可恣意使用不支援的selector及屬性。
input:disabled {
/*修正input disabled樣式*/
color: #666;
background: #ddc;
text-shadow: 1px 1px #FFF;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment