|
Author: Jenny Nguyen
|
|
I have received some questions from readers asking about Position property in CSS. Today, I will introduce to you the Position attribute of CSS property. You will learn how to define and use it properly. The CSS positioning properties allow you to position an element. You can place an element anywhere you want on the web page. Absolute Attribute: Absolute position is based in 4 locations: top, right, bottom, left, along with units such as px, cm and em,%. This is used for alignment by the composition containing it. You can actually just rely on one of the following pairs of position to set a location of an element on the page:
Sample: HTML code: CSS: First: assign attribute position: relative to the #container element. Result: Fixed Attribute: An element with a fixed attribute is positioned relative to the browser window. It will not move even if the window is scrolled. Note: IE7 and IE8 support the fixed value only if a !DOCTYPE is specified. Example: HTML code: CSS: Did you like this tip
|



