Center Position (Horizontal) Div with Absolute Position Attribute CSS

Center Position (Horizontal) Div with Absolute Position Attribute CSS

Center Position (Horizontal) Div with Absolute Position Attribute CSS

Below CSS can be used to center the DIV with absolute positioning.

#DIV_ID/.CLASSNAME {
    position: absolute;
    width:200px;
    right: 0;
    left: 0;
    margin: auto;
    background-color:gray;
}

JS Fiddle (Sample) : http://jsfiddle.net/0k87tzvo/

[ YOU MAY ALSO LIKE ]

Leave a Reply