/* You must use the z-index property */ .element1 { z-index: 2; } .element2 { z-index: 1; } /* all elements with the element1 class will be in front of elements with element2 class */