HTML div positioning image inside container - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Position

Description

HTML div positioning image inside container

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
#map {<!--  www.  ja  va 2  s  .c o m-->
   background-color:Chartreuse;
   width:383px;
   height:525px;
   position:relative;
}

.marker1 {
   position:absolute;
   top:0;
   left:0;
   border:2px solid yellow;
}

.marker2 {
   position:absolute;
   top:223px;
   left:205px;
   border:2px solid blue;
}

.marker3 {
   position:absolute;
   top:258px;
   left:0px;
   border:2px solid pink;
}
</style> 
 </head> 
 <body> 
  <div id="map"> 
   <a class="marker1" href=""> <img src="https://www.java2s.com/style/demo/Opera.png" border="0"> </a> 
   <a class="marker2" href=""> <img src="https://www.java2s.com/style/demo/Firefox.png" border="0"> </a> 
   <a class="marker3" href=""> <img src="https://www.java2s.com/style/demo/Safari.png" border="0"> </a> 
  </div>  
 </body>
</html>

Related Tutorials