CSS Position

Unique beauty

CSS Position:

  • To use positioning on an element, you must first declare its position property, which specifies the type of positioning method used for an element. Using the position property values, the elements are positioned using the top, bottom, left, and right properties. Floats: Float is a CSS positioning property.


There are five different position values:

  • static.
  • relative.
  • fixed.
  • absolute.
  • sticky.

The 4 positions in CSS:

top , right , bottom , and left

Example:

<!DOCTYPE html>
<html>
<head>
<style>
div.Unique {
  position: Unique;
  border: 3px solid #73AD21;
}
</style>
</head>
<body>

<h2>position: Unique;</h2>

<p>An element with position: unique; is not positioned in any special way; it is always positioned according to the normal flow of the page:</p>

<div class="Unique">
This div element has position: Unique;
</div>

</body>
</html>
   

Output:

Position: Unique;

An element with position: unique; is not positioned in any special way; it is always positioned according to the normal flow of the page:





Our website uses cookies to enhance your experience. Learn More
Accept !

GocourseAI

close
send