With the knowledge of CSS Positioning you will be able to manipulate the exact position of your HTML elements. Designs that previously required the use of JavaScript or HTML image maps may now be done entirely in CSS. Not only is it easier to code, but it also loads much quicker.
CSS helps you to position your HTML element. You can put any HTML element at whatever location you like. You can specify whether you want the element positioned relative to its natural position in the page or absolute based on its parent element.
The CSS positioning properties allow you to position an element. It can also place an element behind another, and specify what should happen when an element's content is too big.Elements can be positioned using the top, bottom, left, and right properties. However, these properties will not work unless the position property is set first. They also work differently depending on the positioning method.
<html>
<head>
<style>
p.relative {
position: relative;
left: 20px;
}
p.static {
position:static
left: 20px;
}
p.fixed {
position: fixed;
top: 60px;
left: 15px;
color: red;
}
p.absolute {
position: absolute;
left: 100px;
top: 110px;
}
</style>
</head>
<body>
<p class="relative">It's show the positioning property </p>
<p class="static">It's show the positioning property </p>
<p class="fixed">It's show the positioning property </p>
<p class="absolute">It's show the positioning property </p>
</body>
</html>
Output
Others
Languages
Frameworks
Web / Design
Mobile Technology
Sql & Technology
R4R