Results 1 to 10 of 10
Thread: id seems to work same as class
Apr 27, 2004, 00:28 #1
- Join Date
- Mar 2004
- Western Australia
- 0 Post(s)
- 0 Thread(s)
id seems to work same as class
After reading more about XHTML Syntax Rules at w3schools.com I discovered that:
"The id attribute replaces the name attribute"
<img src="picture.gif" name="picture1" /> (old-html)
<img src="picture.gif" id="picture1" /> (new-xhtml)
I'm not sure what a use for the name is, I've never used it in my work to date as I'm not yet programmer-savvy.
What I really want to know is I am modelling my homepage on the layout template from Cross-Browser.com (see Kevin Yanks css article on multi-column layout) at:
this (template) uses id's, ie ..
..which seem to work the same as css classes. Back in the css sheet a hash (#) is used instead of a period (.) for the id/class. Are the id and class one and the same? in other words can I officially put in my css page:
and then put in my xhtml page:
I've done it to a number of web page elements and the ID method seems to work just as if 'class' is used.