Click to See Complete Forum and Search --> : help with aligning an image


danielOne
08-11-2004, 10:26 AM
i have a image that i would like to place in the middle and center of the browser window...

<div align=... valign...>
tried that didnt work!

<img src=..... align="" valign=""...>
tried that didnt do it....

<table>
<tr>
<td align="" valign="">...</td>
</tr>
</table>
and tried that but it wouldnt work. the only thing it would do is place the picture in the center if i would use div-tags??? why am i not able to change the vertical positioning??

help is needed,

cheers,
daniel

sharkey
08-11-2004, 10:33 AM
Is this what you are looking for heres the css-

.centered {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 50%;
height: 50%;
margin: auto;
background-color: red;
color: white;
}

<div class="centered"></div>


Hope that helps mate.

danielOne
08-11-2004, 10:36 AM
so it would alwalys center the image no matter what resolution the user has!! that is whats important to me!...

cheers,
daniel

sharkey
08-11-2004, 10:42 AM
Yes i would reckon that would be the case mate.