Wednesday, 9 November 2011

Position and aligh text with CSS

The CSS positioning properties allow you to position an element. It can also place an element behind another, and specify what should happen when an element's content is too big.
Elements can be positioned using the top, bottom, left, and right properties. However, these properties will not work unless the position property is set first. They also work differently depending on the positioning method.
There are four different positioning methods.

CSS code:

fixed
{
position:fixed;
top:30px;
right:5px;
}

Static Positioning:-

HTML elements are positioned static by default. A static positioned element is always positioned according to the normal flow of the page.

Fixed Positioning:-

An element with fixed position is positioned relative to the browser window.

Relative Positioning:-

A relative positioned element is positioned relative to its normal position

No comments:

Post a Comment