Google Ads

Learn Responsive Images Using the max-width Property – HTML Code


Learn Responsive Images Using the max-width Property – HTML Code

Notice that in the example above, the image can be scaled up to be larger than its original size. A better solution, in many cases, will be to use the max-width property instead.

Using the max-width Property

If the max-width property is set to 100%, the image will scale down if it has to, but never scale up to be larger than its original size:

 

Code:

<img src="img_girl.jpg" style="max-width:100%;height:auto;">

 

Try Your Self ->

 

Have any Question or Comment?

Leave a Reply

Your email address will not be published. Required fields are marked *