HTML Element Style How to - Resize Div but still keep it centered


We would like to know how to resize Div but still keep it centered.


<!DOCTYPE html>
<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%;
  <div id="center"></div>

The code above is rendered as follows: