We would like to know how to resize Div but still keep it centered.
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
#center {<!--from w w w. ja v a2 s .co m-->
border: 1px solid #000000;
width: 30%;
height: 30%;
position: absolute;
top: 50%;
left: 50%;
margin-top: -15%;
margin-left: -15%;
}
</style>
</head>
<body>
<div id="center"></div>
</body>
</html>
The code above is rendered as follows: