hey, ive got a main container div. how can i position something in there relative to the container like its 1024 pixels wide. how could i make something like 150 pixels to the left and 150 pixels from the top?
<i> </i>margin-left: 150px; margin-top: 150px;
[code=html] #main { width:400px; height: 500px; margin: 250px auto; background: #ff4; position: relative; } #child { width: 50px; height: 50px; background: #833; position: absolute; top: 100px; left: 200px; } </style> <script type="text/javascript"> </script> </head> <body> <div id="main"> <div id="child"></div> </div> [/code]
Help @welsh spread the word by sharing this article on Twitter...