javascript - Div height to image height and image width to div width -
i have div use container , image use "background" (not literally, told couldn't background attribute) , content div:
css
#container { display:table; width: 100%; min-width:100%; } .img1 { //don't know put here; } #content { //not important; }
html
<div id="container"> <img class="img1" src="img.png"/> <div id="content"> content </div> </div>
i need container div 100% screen width, , contained image, while both of them must have image's resulting height (after resizing taking 100% screen width) (no stretching). way that? tried lot of min-height , width combination nothing worked far. prefer css , html solutions, if possible.
not sure mean, how look: https://jsfiddle.net/b76fjtcv/
basically it's
.img1 {width: 100%;}
this updated version of fiddle adds max width img doesn't fuzzy. set max-width of .img1 image's full width.
Comments
Post a Comment