CSS Layout - The Position Property - W3Schools

CSS The position Property ❮ Previous Next ❯

CSS Positioning

CSS positioning is about controlling the placement of elements within a web page.

With CSS positioning, you can override the normal document flow.

The CSS position Property

The position property specifies the positioning type for an element.

This property can have one of the following values:

  • static - This is default
  • relative
  • fixed
  • absolute
  • sticky

Elements are then positioned to their final location with the top, bottom, left, and right properties.

Positioning Topics

This tutorial is divided into the following sections:

  • Static and Relative Positioning - Default positioning and relative offsets
  • Fixed and Absolute Positioning - Viewport-fixed and ancestor-relative positioning
  • Sticky Positioning - Toggle between relative and fixed based on scroll

All CSS Positioning Properties

Property Description
bottom Sets the bottom margin edge for a positioned box
clip Clips an absolutely positioned element
left Sets the left margin edge for a positioned box
position Specifies the type of positioning for an element
right Sets the right margin edge for a positioned box
top Sets the top margin edge for a positioned box
❮ Previous Next ❯ +1 Sign in to track progress

Từ khóa » Bỏ Position