好吧,這裏是myResource.css如何重用和覆蓋Css風格?
.gwtCellButton button { margin: 0; padding: 5px 7px; text-decoration: none; ....more styles here... } .gwtCellButton button:active { border: 1px inset #ccc; } .gwtCellButton button:hover { border-color: orange; color: orange; }
現在我想有.gwtCellButtonSmall
是完全一樣.gwtCellButton
除了它具有padding: 1px 2px;
Ofcourse,如果我不喜歡這一點,那麼我可以複製代碼:
.gwtCellButtonSmall button { margin: 0; padding: 1px 2px; text-decoration: none; ....more styles here... } .gwtCellButtonSmall button:active { border: 1px inset #ccc; } .gwtCellButtonSmall button:hover { border-color: orange; color: orange; }
它的工作很好非常感謝你 – Tum
如果你確保你把更具體的選擇器放在更普通的選擇器下面,那麼不需要使用「!important」。 –
@JohnSlegers好吧 – Charlie