Relative position image : position « Layout « HTML / CSS






Relative position image

 
<html>
<head>
<title>Relative position image</title>
<style type="text/css">
.relative {
 position: relative; 
 top: 100px; 
 left: 20px;
}
</style>
</head>

<body>

   <img src="http://www.java2s.com/style/logo.png" class="relative" alt="cover" />
     <p>This is a test.</p>
  
</body>
</html>

 








Related examples in the same category

1.The position Property
2.CSS provides six positioning models for positioning an element: static, absolute, fixed, relative, float, and relative float.
3.position descendant
4.Normal Flow