Reputation: 7375
i need to center the root div through percentage based width not pixel based
#container
{
width:80%;
margin:0px auto;
}
it will center the container respective to page and working fine in 1366 *706 reoslution. but not working in 1280*1024
i need to center the div to work in both kind of resolutions. how can i resolve this issue when using percentage width concept.
Thanks,
Siva
Upvotes: 0
Views: 160
Reputation: 15779
Here you go.
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.
Upvotes: 1