Java webapp: where/how to automatically set each picture's width/height
Posted
by NoozNooz42
on Stack Overflow
See other posts from Stack Overflow
or by NoozNooz42
Published on 2010-06-03T00:45:49Z
Indexed on
2010/06/03
1:04 UTC
Read the original article
Hit count: 330
For several reasons, a lot of "webmaster guides" (like Google and Yahoo!'s webmaster guides/guidelines) repeats several times that it is better to always put the width and height attribute of the img tag.
One of the most obvious reason is that the elements in the page won't seem to be "jumping around" to a new location after every picture is loaded (always setting the correct width/height sure gets rid of this behavior). And there are other reasons to follow these guidelines / best practices.
So:
- if we consider that these are indeed good practices
- if there are a lot of pictures and they are changing often
- if pictures aren't changing between two .war re-deploy (that is: there's no user-contributed picture)
- if we don't want to manually edit all these width/height attributes
How do we automatically/programmatically serve HTML pages where every img tag have their width/height attribute correctly set as the best practice recommend?
© Stack Overflow or respective owner