internet explorer - PNG img displays in Visual Studio Designer but not IE -


i writing webpage. want there banner image on top of webpage. here html , css:

index.html

<!doctype html> <html> <head>     <title>protect environment!</title>     <link rel="stylesheet" type="text/css" href="styles.css" /> </head> <body>     <div>         <img src="http://intranet.kings.edu.hk/~s13977/banner.png"             id="banner-image"              alt=""/>      </div> </body> </html> 

styles.css

body {     background:#f8e4e4;     font-family:'segoe ui', tahoma, geneva, verdana, sans-serif;     font-size:medium; }  #banner-image {     height: 106px;      width: 582px; } 

as can see, did put image in html , src set correct url. can copy url , check. here how looks visual studio designer: enter image description here

but when run ie, looks this: enter image description here

i tried add #banner-image css rule:

visibility:visible; 

but doesn't work @ all. page stays same!

i think there problems div want keep it. makes things easier manage.

in testing, didn't find difference in html ordering, although wasn't extremely thorough. adding float class directly image or in surrounding <div> makes no difference, images still not show up.
fortunately, fix quite simple! add 3 lines css. file , problem solved.

no hacks, no conditionals, pure, validating css.

img {     position: relative; } 

for many headaches got dealing internet explorer's inadequacies, slap on face when realized how simple solution is. relative positioning magic fix in ie, try out if you've got odd quirk that's causing grief!

note : tested , workied fine


Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -