Just nu i M3-nätverket
Jump to content

Validering XHTML


Jompan

Recommended Posts

Kan någon hjälpa mig med vad denna info betyder, så när som på att </p> ska stängas efter </a>.

 

"

Line 12, Column 55: end tag for element "a" which is not open

<a href="http://www.w3.org/">http://www.w3.org/</p></a>✉

The Validator found an end tag for the above element, but that element is not currently open. This is often caused by a leftover end tag from an element that was removed during editing, or by an implicitly closed element (if you have an error related to an element being used where it is not allowed, this is almost certainly the case). In the latter case this error will disappear as soon as you fix the original problem.

 

If this error occurred in a script section of your document, you should probably read this FAQ entry."

 

// Jompan

Link to comment
Share on other sites

Jag ser nu att jag tyvärr kopierat fel kod. Min sträng börjar med <p>:

<p><a href="http://www.w3.org/">http://www.w3.org/</p></a>✉

 

Line 12, Column 55: end tag for element "a" which ....

 

Jag försöker förstå vilka av följande alternativ som kompar med felanvisningen:

 

1. Självstängande element som a är avslutas med />

2. För bilder anges en alt-text för dem som ev inte kan se texten

3. Eftersom man öppnat p-elementet måste a-elementet stängas före p

4. Ett inline-element får inte läggas direkt i body utan det ska omslutas med lämpligt blockelement.

 

Efter flera gissningar kvarstår bara nr 1. Stämmer den verkligen med felinformationen?

 

// Jompan

Link to comment
Share on other sites

Du har taggarna i "fel" ordning.

 

Du har : <p><a>....</p></a>

 

Rätt : <p><a>....</a></p>

 

eller : <a><p>....</p></a>

 

Taggarna måste omsluta varandra, inte abrytas mitt i.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...