Gå til innhold

Problemer med anchored links


Anbefalte innlegg

Hei!

 

Har lagt inn såkalte "anchored links" på web-siden min. Slik at når man

trykker på en link, hopper man til et bestemt punkt på samme side.

Laget de slik; en label som referer til punktet på siden: <a name="top"></a>

og selve linken slik: <a href="#top">til toppen</a>

 

Men ved validering av siden får jeg følgende feilmelding:

 

Klikk for å se/fjerne innholdet nedenfor

Error Line 11 column 16: there is no attribute "name".

 

<a name="top"></a>

 

You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

 

This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

 

How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.

 

 

Bruker dette flere steder på siden, men får kun feilmelding på den første av disse.

 

Noen som vet hva som kan være feil, eller om det går å løse dette på andre måter?

Lenke til kommentar
Videoannonse
Annonse

Jeg tror name-feil er feil som bare popper opp 1 gang pr. validering - som feilmeldinga sier :

You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute) ... 

Lenke til kommentar
name skal bare være på form, input, textarea, select.

8130464[/snapback]

Feil. NAME attributtet (?) er ikke gyldig XHTML i følge denne siden og har ihvertfall ingen ting å gjøre med de elementene du nevnte.

 

ID brukes i stedet for NAME, og fungerer på akkurat samme måten, og må som Ståle sier, være unikt.

Endret av Runar
Lenke til kommentar

Opprett en konto eller logg inn for å kommentere

Du må være et medlem for å kunne skrive en kommentar

Opprett konto

Det er enkelt å melde seg inn for å starte en ny konto!

Start en konto

Logg inn

Har du allerede en konto? Logg inn her.

Logg inn nå
  • Hvem er aktive   0 medlemmer

    • Ingen innloggede medlemmer aktive
×
×
  • Opprett ny...