html - Can't get image to center when I change the browser size -
i've created image using gimp , have imported website creating. reason not want center when resize browser. in addition, unless set it's position absolute, moves middle of page( want center, top). believe has size of image. 1920x1080 , used size because of quality, think background getting used when import it. i've tried in gimp cut out background. suggestion on code or how fix in gimp great.
<div id="logo"> <img src="dtw logo\dtw2_logo_colombianflagcolortopcropped.png" > </div> body{ margin: 0px; padding: 0px; height: 100%; width: 100%; } #logo{ margin: -368px 450px 0px 0px; position: absolute; width: 100%;
}
use css width
property in percentage measurement, , margin
set auto
on both side left , right,
css
#logo{ margin:0px auto; top:0px; width:100%; text-align: center; }
view demo jsfiddle
set image width on percentage:
img{ width: 15%; /*width: 75px */ }
view jsfiddle
Comments
Post a Comment