We would like to know how to center root div through percentage width in all kind of resolutions.
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
#container {<!--from w w w . j a v a 2 s .c o m-->
width: 80%;
margin: 0px auto;
background: green;
}
html {
width: 100%;
min-width: 100%;
}
</style>
</head>
<body>
<div id="container">java2s.com</div>
</body>
</html>
The code above is rendered as follows: