Forum Moderators: not2easy

Message Too Old, No Replies

<div> already used

W3C validation problem

         

reddevil

8:22 am on Feb 10, 2004 (gmt 0)

10+ Year Member



Hi,
I cannot get my pages to validate because the W3C validator tells me that I am using the same <div> name more than once. But I thought that you COULD use it more than once as long as it was a "class" of a <div>?

I have a basic site that consists of

Content Paragraph 1 <div id="content">
Row of photos
Content Paragraph 2 <div id="content" class="para2">
Row of Photos
Content Paragrah 3 <div id="content" class="para3">
Bottom Menu

My page is completely contained within one big table and I am using CSS for styling purposes only.

I want to try and use good coding practice and so was trying to use different "classes" but what is it that I am doing wrong?

highman

8:26 am on Feb 10, 2004 (gmt 0)

10+ Year Member



id= can only be used once, if you want to use the same <div> several times then you must use class=

reddevil

8:37 am on Feb 10, 2004 (gmt 0)

10+ Year Member



Thanks highman,
But I thought I have used class=
as per the code I posted earlier?

highman

8:49 am on Feb 10, 2004 (gmt 0)

10+ Year Member



Content Paragraph 1 <div id="content">
Row of photos
Content Paragraph 2 <div id="content2">
Row of Photos
Content Paragrah 3 <div id="content3">
Bottom Menu

or

Content Paragraph 1 <div class="content">
Row of photos
Content Paragraph 2 <div class="content">
Row of Photos
Content Paragrah 3 <div class="content">
Bottom Menu

As above id= is a one off use, class= can be used over and over

reddevil

9:30 am on Feb 10, 2004 (gmt 0)

10+ Year Member



aha - the penny has dropped (or the cent has dropped - depending on which country you are in).

Thanks.

highman

9:36 am on Feb 10, 2004 (gmt 0)

10+ Year Member



euro cent :)

domokun

9:43 am on Feb 10, 2004 (gmt 0)

10+ Year Member



ive heard that the w3c validator is currently broken.