Place a border around X Y position on page - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Border Style

Description

Place a border around X Y position on page

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">

#container {<!--from   www  .j  ava 2s  .c  o  m-->
   width: 400px;
   background: rgb(240, 240, 240);
}
#myDiv {
   width: 200px;
   position: relative;
   background: rgb(220, 220, 220);
   margin: 0 auto;
   padding: 10px;
}
#inexplicableBorder {
   width: 50px;
   height: 50px;
   position: absolute;
   top: 5px;
   left: 5px;
   border: 1px solid red;
}


      </style> 
 </head> 
 <body> 
  <title>WOW</title> 
  <div id="container"> 
   <div id="myDiv"> 
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> 
    <div id="inexplicableBorder"></div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials