- This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Hello. I was wondering which of these methods is considered the best practice for defining image height/width. Thank you for the suggestions!
OR
In css/style.css:
img.large {
width: 700px;
height: 400px;
}
My personal opinion is to use CSS for images. It’s just easier to go into your stylesheet and make the changes to a group instead of one by one. As for best practice, it’s more of a preference.
Hmm, I’ve never heard that before. May I ask who told you this? I use inline styling when a stylesheet is not needed because the code is too limited to load an additional file.
I believe though that if your loading an external stylesheet in your head section that it is to be rendered before anything else. Wouldn’t that totally disprove this theory if you have img tags in your body using inline styling?
A reminder to not be resizing very large images (ie 2mb) because the end user will still have to download the entire image.
If you have a lot of images that are not the same size, using just css can be more cumbersome. But, ideally it is best. As for image resizing, you shouldn’t really be using the browser to do that at all.