January 23, 201115 yr <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Untitled</title> </head> <body> <style type="text/css"> #one, #two, #three {width: 200px; height: 150px; position: absolute;} #one {background: #f00; z-index: 1; top: 0px; left: 0px;} #two {background: #0f0; z-index: 2; top: 40px; left: 40px;} #three {background: #00f; z-index: 3; top: 60px; left: 80px;} </style> <div id="one">one</div> <div id="two">two</div> <div id="three">three</div> </body> </html>
January 23, 201115 yr Author <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Untitled</title> </head> <body> <style type="text/css"> #one, #two, #three {width: 200px; height: 150px; position: absolute;} #one {background: #f00; z-index: 1; top: 0px; left: 0px;} #two {background: #0f0; z-index: 2; top: 40px; left: 40px;} #three {background: #00f; z-index: 3; top: 60px; left: 80px;} </style> <div id="one">one</div> <div id="two">two</div> <div id="three">three</div> </body> </html> Thanks.So basically its to do with stacking order?
January 23, 201115 yr Yes, its to do with stacking elements. Lev's example is a good one to start off with. Basically, you instruct the browser to place elements in stacking format with Z-index. You can also see a working example at http://www.w3schools.com/css/tryit.asp?filename=trycss_zindex
Create an account or sign in to comment