Wednesday, 15 July 2015

CSS classes under a class -



CSS classes under a class -

this question may foolish, though want know experts in css. there way write css classes under 1 class.

suppose have few divs under div

<div class="parent"> <div class="c1"></div> <div class="c2"></div> <div class="c3"></div> </div>

normally, write css classes below-

.parent { width: 100%; } .parent .c1 { //somecode } .parent .c2 { //somecode } .parent .c3 { //somecode }

but, want know. can write below-

.parent { width: 100%; .c1 { //somecode } .c2 { //somecode } .c3 { //somecode } }

please allow me know reply on curiosity. you.

you can't using normal css.

maybe looking less? nested rules section farther downwards page.

this allows asking, along many other useful functions, variables , mixins.

alternatively there alternative of sass. similar less.

css

No comments:

Post a Comment