Is there a way to adjust the size of a picture in a CSS document?
May.29, 2007 in
CSS
Jazilliania B asked:
So if I have a picture in the layout. But I replace it with another picture that’s too big. Is there a way to say “I want it to be this wide”? I know there is in html, but I’m not as familiar with CSS.
I’m reading a tutorial right now, but if anyone knows of any tutorials that address pictures in CSS, that’d be a big help.
Custom Search
May 31st, 2007 at 2:55 pm
Well… rather than give you an answer to your question, can I make another suggestion? It’s a bit of a no-no to resize images in the browser, since it tends to look bad, and if it’s scaling down, make the file sizes too large (very important in website design). I would really really suggest just resizing the image to the proper viewing size and then using it.
Now, if you really MUST resize it … you should probably actually just do it in the markup (in html) in the img tag.
And if you must resize it in CSS… here is how:
(Use your own class names and values)
imageclass
{
width: 123px;
margin:123px;
}