css outer div max-width scale inner image -
is possible fit image outer div width limited max-width?
here fiddle example: http://jsfiddle.net/7uzg7/
<div style="width:100%;"> <div style="max-width:30%; background-color:red; float:right; padding:10px;"><img src="http://www.acasa.org.br/ensaio/grande/506.jpg"></div> lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum </div>
sure :)
make css so
.container { width:100%; } .image-container { width:100%; max-width:30%; } .image-container img { width:100%; height:auto; }
and html so
<div class="container"> <div class="image-container"> <img src="/img/source"> </div> <p>your text</p> </div>
as side note, try not inline style items - makes less reusable code. let me know if there else answer.
Comments
Post a Comment