CSS Position Property Tutorial | Coding Tag
×

CSS Position

3665

Position specifies the type of positioning method for a particular element.

Position values are static, relative, fixed, absolute.

Static Example:

position: static; It's a Default value.
#mybox {
position:static;
width:100px;
height:100px;
background:blue;
padding:20px;
}

Relative Example:

position: realtive; A relative positioned element is positioned relative to its normal position
#mybox {
position:relative;
width:100px;
height:100px;
background:blue;
padding:20px;
}

Absolute Example:

position:absolute; The element is positioned relative to its first parent element
#mybox {
position:absolute;
width:100px;
height:100px;
background:blue;
padding:20px;
}

Fixed Example:

position:absolute; The element is used for fixed the content in browser
#mybox {
position:fixed;
width:100px;
height:100px;
background:blue;
padding:20px;
}



Best WordPress Hosting


Share:


Discount Coupons

Get a .COM for just $6.98

Secure Domain for a Mini Price



Leave a Reply


Comments
    Waiting for your comments