Images staying at same position in html -


i'm working on basic html page , i'm still learning html. anyway have 2 images on pages i've placed on position want problem if resize web page/ browser image isn't @ it's correct position anymore. or because gave speficic location pixels want remain @ same location no matter how big browser window is.

if understand me.

my current code:

<div style="position: absolute; left: 590px; top: 320px;"> <img src="map.png" width="215" height="202"> </div> 

you have use percentage, example:

html

<img class="imageel" src="folder-image-transp.png" width="215" height="202"> 

css

img.imageel{    position:absolute;    left: 50%;    top: 50%; } 

if want element remain @ middle of screen, have apply margin big half of image. example:

img.imageel{    position:absolute;    left: 50%;    top: 50%;    margin-left: -(half of image width)px    margin-top:  -(half of image height)px } 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -