Thank you--everyone. The answers were most helpful.
Edd
www.thehalehouse.com
---BeginMessage---
Title: Image size--where should it be?
I am new to CSS and I am not sure if the image size (width and height) should appear in the HTML or be handled by CSS. Thank you.
Edd
---End Message---
If the image is used in the html than specifying height width is god
eg: img src=image.jpg height=10 width=20
If the image is used in css eg:
background: url(image.jpg);
than I have never seen the height and width specified (I dont even know
if you can)
--
Neerav Bhatt
http://www.bhatt.id.au
Well, the W3C validation page recommends using either!
Demonstrating valid CSS:
p
a href=http://jigsaw.w3.org/css-validator/;
img style=border:0;width:88px;height:31px
src=http://jigsaw.w3.org/css-validator/images/vcss;
alt=Valid CSS! /
/a
/p
Demonstrating valid XHTML:
p
a
Hi Edd
You can do it in both areas traditionally you would specify it in the
HTML, but as Patrick Griffiths demonstrates at HTML dog -
http://www.htmldog.com/articles/elasticdesign/demo/ - you can make your
images elastic if you have the dimensions in the CSS.
Cheer
Jeff Lowder
Accessibility
Is there really any reason to have it either place? Isn't it just extra
code that doesn't have to be there?
On Aug 12, 2004, at 6:29 PM, Joshua Street wrote:
Well, the W3C validation page recommends using either!
Demonstrating valid CSS:
p
a href=http://jigsaw.w3.org/css-validator/;
img
Edd,
Without sounding like fence sitting, the answer would be it depends on the
situation and personal opinion.
You probably should start by separating out images into two categories;
(1) decorative images
(2) content-based images
(1) A decorative image is one that is purely superficial -
G'day
I am new to CSS and I am not sure if the image size
(width and height) should appear in the HTML or be
handled by CSS. Thank you.
Width and height are valid attributes for images in HTML and XHTML, even in
the Strict flavour.
The only time I would specify it in CSS rather than
On Friday, Aug 13, 2004, at 09:59 Australia/Sydney, Edd Hale wrote:
I am new to CSS and I am not sure if the image size (width and height)
should appear in the HTML or be handled by CSS. Thank you.
Edd
Aside from the validity/informational/decorative issues, the inclusion
of width and height