How to specify dimensions of Img Src in HTML so that page can be XHTML strict

The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

How to specify dimensions of Img Src in HTML so that page can be XHTML strict

Hi there,

I have encountered a problem when trying to get my page to validate to XHTML Strict - currently I am controlling the size of an image within the HTML. I am only doing this because I have a load of images and I am controlling them through a database and don't want to have to create duplicate images in thumbnail size - is there anyway around this problem?

Use height="95" instead of height=95px (same for width). Also, you have the code

Code:

<img height=95 width 95 src="images/services/SEO.jpg"

(missing the = for width).

Also, I would highly recommend generating thumbnails for your images and storing them in the database as well. You'll save a lot of bandwidth, but more importantly, your client's load times will be much lower because they won't have to load a huge image only to have it scaled down client side.