<div class="first-div"> <div> </div> </div> div is in the external <div class="first-div"> , like when you click on <div class="first-div"> change the style of the internal div , and when it is pressed again, roll back. Preferably using only css.