[thelist] Images dimensions in CSS?

Andy Waite Andy.Waite at company-net.com
Thu Feb 8 06:01:31 CST 2001


Since the main reason for using CSS is to seperate content from
presentation, should CSS be used in place of of width and height attributes
for images?

For example, instead of:

<img src="logo.jpg" width="10" height="20">

you could have

<img src="logo.jpg" id="logo">

and use this CSS:

<style type="text/css">
#logo {width: 10px; height: 20px;}
</style>

Any thoughts?

<tip type="Image Tags">
Instead of setting border=0 on every image which is a hyperlink, just use
this line of CSS:

A IMG {border: none;}
</tip>



--
Andy Waite <andy.waite at company-net.com>
Database Web Developer
Company Net <http://www.company-net.com>
Tel: +44 (0)131 559 7500 Fax: +44 (0)131 559 7501




More information about the thelist mailing list