html - Define rule for set of child elements -
as example, want labels
, input
fields within class
have similar rules.
css
.specialbox input, label{ background-color: green; }
when use previous code, apply rules input field within specialbox , all labels because ruleset applies each of comma separated items:
.specialbox input
label
i can modify selector clarify both items individually
.specialbox input, .specialbox label{ background-color: green; }
in case desired result, @ expense of being concise
here's fiddle demonstrate
is there way apply set of rules children of particular selector, or forced repeat parent element selector?
i believe there way sass or less, i'd prefer straight css
for input
, label
elements, have repeat selector.
if want children, can use wildcard: .specialbox *
apply style of children.
Comments
Post a Comment