HTML CSS examples for CSS Layout:Position
overlap a div to an another div without changing their positions
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> div#menu { text-align:center; font-size:121%; background-color:Chartreuse; padding:0.2%; height:21%; width:50%; margin-left:auto; margin-right:auto; position:relative; z-index:2;<!--from ww w . java2 s . c o m--> } div#divSlogan { background-color:yellow; width:51%; margin-left:auto; margin-right:auto; margin-top:-2.16%; padding:0.2%; -moz-box-shadow:0px 0px 11px 3px blue; -webkit-box-shadow:0px 0px 11px 3px pink; box-shadow:0px 0px 11px 3px OrangeRed; text-align:center; position:relative; z-index:6 ; } </style> </head> <body> <div id="divSlogan"> Lorem ips </div> <div id="menu"> Lorem ipsum dolor sit am <a href="https://www.google.co.in">Lore</a> </div> </body> </html>