i need to center the root div through percentage based width not pixel based
#container { width:80%; margin:0px auto; }
it will center
add padding-left and padding-right. also give width=100%
Here you go.
WORKING DEMO
The HTML Code:
<div id="container"> </div>
The CSS Code:
#container { width:80%; margin:0px auto; background:green; } html{width:100%; min-width:100%;}
Hope this helps.