нормально, вот 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 Okay – Charlie