HTML Positioning

CSS provides a property, position, which controls the position of elements with respect to the normal flow of the content on a web page. You can apply the position property on any HTML. element , such as <P>,<DIV>,<TABLE>,<FORM>,<TEXTAREA>. HTML Positioning syntax to use the position property is given as follows.

 

  • relative – Specifies relative positon of a element with respect to the normal flow the content.
  • absolute – Specifies the position of block element with respect to the normal flow of the content.
  • fixed –   Fixes the position of an element with respect to the normal flow of the content.
  • static –  Specifies that an element uses the same settings fo position as of its  parent element

 

Code of HTML Positioning :

p

{

position :fixed;

}

CSS also provides some properties that specify the offset position of an element with respect to the normal flow of the conent of a Web page.

HTML Positioning properties are given as follows:-

  • top – Offsets an elemetn in the top direction of a Web age
  • bottom –  Offsets an element in the bottom direction of a Web page
  • left –  Offsets an element in the left direction of a Web page.
  • right – Offsets an element in the left direction of a Web page.

P

{

position :fixed;

top:10px;

right:5px;

}

 




Follow Us

Contact Us

tutorialworldin@yahoo.com

Back to Top