Skip to content Skip to sidebar Skip to footer

Positioning An Absolute Element In The Center Of It's Relative Parent Element

here is my code i want child element to be at bottom and center of it's parent it's in the bottom alright but i cant get it to center i've tried text-align:center ; for parent a

Solution 1:

This might answer your question: Centering a percent-based div

Use percentages with your margins.

<divstyle='background-color:green;position:absolute;width:80%;bottom:0;margin-right:10%;margin-left:10%;padding:5px'>

Demo: http://jsfiddle.net/DkNdx/

Post a Comment for "Positioning An Absolute Element In The Center Of It's Relative Parent Element"