1.

In how many ways can we position an HTML element? Or what are the permissible values of the position attribute?

Answer»

There are mainly 7 values of POSITION attribute that can be used to position an HTML element:

  1. static: Default value. Here the element is positioned according to the normal flow of the document.
  2. absolute: Here the element is positioned relative to its parent element. The final position is DETERMINED by the values of left, RIGHT, top, bottom.
  3. fixed: This is similar to absolute except here the elements are positioned relative to the <html&GT; element.
  4. relative: Here the element is positioned according to the normal flow of the document and positioned relative to its ORIGINAL/ normal position.
  5. initial: This resets the property to its default value.
  6. inherit: Here the element inherits or takes the property of its parent.


Discussion

No Comment Found