Using two CSS classes on one element

Posted under » CSS on 11 November 2015

Works on CSS3 or modern browsers.

<div class="jindent right">text here</div>

It is with a space, we can invoke the child of jindent and class jindent itself.

.jindent { margin-left: 18px; } 
.jindent.right { margin-right: 50px; } 

However, if you want to mix id with class. you need to do this.

<div id="jindent" class="right">text here</div>
And
#jindent { margin-left: 18px; } 
#jindent.right { margin-right: 50px; } 
 

web security linux ubuntu python django git Raspberry apache mysql php drupal cake javascript css AWS data