Fixed effect of div within a parent div - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Div

Description

Fixed effect of div within a parent div

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">
.a {<!--from  w w w.j a  v a  2 s  . co  m-->
   width:201px;
   height:1001px;
   background-color:Chartreuse;
}

.b {
   width:21px;
   height:21px;
   background-color:yellow;
   position:absolute;
   top:0;
   left:0;
}
</style> 
 </head> 
 <body> 
  <div class="a">
    &nbsp; 
   <div class="b">
     &nbsp; 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials