CSS Position



CSS Tutorial  >  Position

The position property specifies what kind of position is used. Possible values include:

  • static (default): indicates that the element will be placed at the default location. Please note that if static is specified, values for the top, bottom, right, and left properties will have no effect.
  • absolute: places an element in relation to the actual browser window. The position of the element moves along with the rest of the content when the page is scrolled.
  • relative: specifies how the element will be positions relative to how it would have been positioned by default.
  • fixed: places an element in relation to the actual browser window. The position of the element remains fixed even when the page is scrolled.

From the list of possible values, we can see that the position property by itself does not have a lot of value. After all, what does {position:relative;} mean if there is no information on what it is relative to? So, clearly additional properties are needed to complement the position property. They are as follows:

  • top
  • right
  • left
  • bottom
  • overflow
  • z-index

    Next: CSS Absolute




    Copyright © 2024   1keydata.com   All Rights Reserved   Privacy Policy   About   Contact
  • AdBlock Detected!

    Our website is made possible by displaying ads to our visitors. Please supporting us by whitelisting our website.