...

View Full Version : How can I fix duplicate ids for valid html?



cpkid2
11-11-2009, 06:34 PM
I have a portfolio with a list of projects, each project being in a div labeled "project". The problem is that this produces invalid html. What would be the best solution for this?

met
11-11-2009, 06:42 PM
if you are using ID's you should only have one instance of each ID in any given document.

change the ID to a class, or use different ID names.

Excavator
11-11-2009, 07:12 PM
Hello cpkid2,
Instead of styling #project in your CSS and having a bunch of <div id="project">'s in your markup a class would look more like this:

.project {
...
}
and
<div class="project"></div>
<div class="project"></div>
<div class="project"></div>
<div class="project"></div>

id vs class (http://www.tizag.com/cssT/cssid.php)


.

cpkid2
11-11-2009, 07:12 PM
Sweet, thanks guys.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum