Is there a way to force an image to a cell or div size without setting a size on the image directly (primarily keeping it from blowing out the div or cell - too large)? I have some ads that come as <a href="link-off-my-site.html"><img src="http://link-still-not-my-site.jpg"></a> Without using some type of script to separate the above so I can specify the size (and then reassemble), how can I force the image to play nice with my size specifications? Thanks for any ideas.
<div style="width: 300px; height: 200px;"> <a href="link-off-my-site.html"> <img style="width: 100%; height: 100%;" src="http://link-still-not-my-site.jpg"> </a> </div> Code (markup): Above, the linked picture is placed in a div that has a specific width and height (300px by 200px) in CSS. Using CSS, the image will stretch to the width and height of the div surrounding it, (300px by 200px).
Thanks for the reply, but I don't want to have to modify the img parameters if possible. So, that would mean no width or height declarations in the image (as I get it almost exactly the way as my example). I can declare the div that surrounds the link/image, however that seems to do no good if the image is larger than the div itself (in any direction).
<div style="width: 300px; height: 200px; overflow: hidden;"> <a href="link-off-my-site.html"> <img src="http://link-still-not-my-site.jpg"> </a> </div> Code (markup): Where the div's overflow is hidden.
Hmmm, that might be what I'll have to go with. I didn't think about just chopping off the excess (by hidden). Thanks. Any other ideas?