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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With