position an element relative to the screen viewport - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Relative Position

Description

position an element relative to the screen viewport

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">
#myDiv {<!--from   www . ja v  a  2s.  c  om-->
   position:fixed;
   bottom:6px;
   right:6px;
   background:red;
   padding:21px;
}
</style> 
 </head> 
 <body> 
  <div id="myDiv"></div>  
 </body>
</html>

Related Tutorials