<!DOCTYPE html> <meta charset='UTF-8'/> <style> .parent { position: relative; margin: 0px; padding: 0px; } .child { position: absolute; margin: 0px; padding: 0px; left: 0px; right: 0px; } </style> <br><br><br> <div class='parent'> <div class='child'>ONE</div> <div class='child'>two</div> </div>
Programming Tips - css: How can I put two divs on top of each other?
Date: 2017dec20
Language: css
Platform: web
Keywords: cascading style sheets, overlay, overlap
Q. css: How can I put two <div>s on top of each other?
A. Use position:absolute like this.