ID's only used once?

Discussion in 'HTML' started by mfunkmann@yahoo.com, Mar 21, 2006.

  1. Guest

    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
    , Mar 21, 2006
    #1
    1. Advertising

  2. 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/
    Benjamin Niemann, Mar 21, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Field
    Replies:
    3
    Views:
    20,201
    Field
    Jun 17, 2005
  2. Seebs
    Replies:
    2
    Views:
    72
    Eric J. Roode
    Aug 4, 2003
  3. Dan Jacobson

    perl -ws and "used only once" warnings

    Dan Jacobson, Oct 28, 2003, in forum: Perl Misc
    Replies:
    2
    Views:
    170
    Brian McCauley
    Oct 28, 2003
  4. Greg Ercolano
    Replies:
    5
    Views:
    282
    Greg Ercolano
    Mar 6, 2006
  5. Replies:
    1
    Views:
    145
    A. Sinan Unur
    Jun 12, 2009
Loading...

Share This Page