Responsive images with one line of CSS
img {
max-width: 100%
}
This will make your images responsive, they will be their natural size unless thier parent is too small, in that case they will shrink and be the size of the parent.
If you want it as an inline style try:
<img src="/theImg.jpg" style="max-width: 100%">
</div>
Written by Brad Evans
Need a reliable senior engineer in your corner?
I have 20+ years of experience building production software, leading engineering teams, and shipping mobile & web apps. No middle-men—just direct, pragmatic engineering.