For fixed size :

#center{
   
width:500px;
   
height:300px;
   
position:absolute;
   
top:50%;
   
left:50%;
   
margin:-150px 0 0 -250px;
}

If you want to resize your div with the screen you can use this technique which works for div too.