Set Image width using inline css

css, html

Solution

Use `max-width`

You can use the `max-width` property which is supported in all modern browsers and IE 8 and above.

To use it call it in your css like so:

div img { max-width: 100%; }

This will stretch your image to the `div`'s width.

Problem

I want to set the width of Image. here is my code :- ``` <div style="width: 630px;"> <img src="Image/welcomeimage.jpg" alt="no image" /> </div> ``` Here is my situation, I don't have to set the width of Image. Only I can set the width of Div. So I have to set the image width using div. How can I do this? [Edit] Thanks to all for helping me. Now I solved my problem. Initially, I was told not to use CSS, I had to solved this issue using Inline CSS. But It was not possible. So I decided to use CSS.

Original source