1 reply [Last post]
Last seen: 16 years 2 weeks ago
Joined: 2005-11-14
Posts: 1
Points: 0

i am new to CSS and am working on a redesing of my site (www.absolutemotions.com/new/index.html)
i though i had done most things correctly, however, when i go and validate wmy code, i get some erros that i will fix, but one that i do not understand:

Line 66 column 18: ID "newslist" already defined., i have many of them since i reuse a lot of the id's i use for my div's.
Now CSs being a programmer's language, and i know that programmers and programming languages are made to reuse code as much as possible i don't get the idea behins this error, are the people creating the css and xhtml language working for micro$oft or something?
why can i not re-use something i have already written, it save time, and i would guess, not just for me, but for browser loading and stuff like that.
does anybody have a solution (except me renaming my ids with ...1, ...2, ...3, etc...)? this is such a waste of time....

Anonymous's picture

Re: re using the save DIV in one page

ID is for identifying a specific item on the page. There can be only ONE.

For reusing a definition in css you must use CLASS instead of ID.

Think of it this way. There are classes of people, one of which you may fit into but there is only one person with your ID.