Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > ID's only used once?

Reply
Thread Tools

ID's only used once?

 
 
mfunkmann@yahoo.com
Guest
Posts: n/a
 
      03-21-2006
Hello,

I want to make my Homepage completely w3 validator compatible. I fixed
most of the errors but one I can't fix:

Error Line 15 column 10: ID "MENUPOINT" already defined.

<div id="menupoint"><br><a href="index.php?get=2">Contact</a></div>

An "id" is a unique identifier. Each time this attribute is used in a
document it must have a different value. If you are using this
attribute as a hook for style sheets it may be more appropriate to use
classes (which group elements) than id (which are used to identify
exactly one element).

So I have declared all styles in seperate file linked in the head
(<link href="style.css" type=text/css rel=stylesheet>)

a typical entry in this file looks like this:

#menupoint
{
border-bottom: 1px solid #A6A0C7;
}



So how should I replace <div id"..... to get the same result??

Thx

Matthias

 
Reply With Quote
 
 
 
 
Benjamin Niemann
Guest
Posts: n/a
 
      03-21-2006
wrote:

> I want to make my Homepage completely w3 validator compatible. I fixed
> most of the errors but one I can't fix:
>
> Error Line 15 column 10: ID "MENUPOINT" already defined.
>
> <div id="menupoint"><br><a href="index.php?get=2">Contact</a></div>
>
> An "id" is a unique identifier. Each time this attribute is used in a
> document it must have a different value. If you are using this
> attribute as a hook for style sheets it may be more appropriate to use
> classes (which group elements) than id (which are used to identify
> exactly one element).
>
> So I have declared all styles in seperate file linked in the head
> (<link href="style.css" type=text/css rel=stylesheet>)
>
> a typical entry in this file looks like this:
>
> #menupoint
> {
> border-bottom: 1px solid #A6A0C7;
> }
>
>
>
> So how should I replace <div id"..... to get the same result??


Use the CLASS attribute:

<div class="menupoint">...</div>

And in your stylesheet:

..menupoint
{ ... }


And a more global remark. Perhaps what you want to achive should better be
done like this:

<ul id="menu">
<li><a ... </a></li>
<li><a ... </a></li>
<li><a ... </a></li>
</ul>

With a stylesheet like

#menu
{
list-style: none;
margin: 0;
padding: 0;
}

#menu li
{
border-bottom: 1px solid #A6A0C7;
margin-top: 1em;
}

--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I am buying all of the below Cisco equipment USED OR NEW. NOTE someline items say new or used, but I will buy them in both conditions. network buyer VOIP 0 12-23-2010 01:26 AM
Can Groovy be used in an applet and/or can it generate the Java bytecodes that then can be used in an applet? Casey Hawthorne Java 1 03-18-2009 12:56 AM
Is there a perl package, or data in a form easily used by a perlscript, that can be used to determine when to change to or from daylightsavings time? Ted Byers Perl Misc 23 11-15-2008 05:53 PM
My boss so cheap!! Our ASP.NET only have 256MB only! How to release request used memory when Page Unload() event raise? ABC ASP .Net 7 01-13-2006 03:23 PM
Unreadable file on Canon S 400.I used a I used a Joseph Miller Digital Photography 3 01-13-2004 09:40 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57