How can I fix a div in a position and it can stay at the same place when I resize my windows?

Hello Guys

I have three DIVs:

First: It is a container that Allow me to center my second DIV in horizontal and vertical center.
In the middle of the second DIV I have another DIV and I want it to stay in the same place when I resize my window. How can I do that?

please, take a look at my code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<style type="text/css"> 
body {
        font-size: 12px;
        font-family: arial, helvetica, sans-serif;
        color: #333;
p {
        margin: 1em;
.comments {
        background-color: #e3e3e3;
        border-top: 1px solid #ccc;
        border-bottom: 1px solid #ccc;
        padding: 2px;
#mydiv {
        top: 50%;
        left: 50%;
        margin-top: -300px; /*set to a negative number 1/2 of your height*/
        margin-left: -400px; /*set to a negative number 1/2 of your width*/
        border: 1px solid #ccc;
        background: #FFF; 
table {position: relative; height: 500px; top: 50%; margin-top: -250px;}

#apDiv1 {

<div id='mlk' class='menu' style='position:absolute; top:-10000px; left:-10000px;'></div>
<div id="mydiv" align="center">
   <table width="700" border="0">
      <td height="450"><img src="Imagem/entrada_ht_link_1.jpg" width="700" height="450" /></td>
<div id="apDiv1"></div>

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Paul MacDonaldDirector, Information SystemsCommented:
Here's some info on element positioning:
It's not clear if you want the innermost DIV to be fixed relative to the browser window or it's parent DIV.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
hidrauAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.