Hilfe bei validierung von hmtl

djws

www.zocke.es
ID: 31169
L
20 April 2006
4.479
289
Hi Leute,

kann mir einer sagen was an folgendem Code falsch sein soll ??

Code:
Design by: <a href="https://www.styleshout.com/" target="_blank">styleshout</a>

da bekomm ich nen Fehler wenn ich die Seite validieren möchte Siehe Hier
 
In XHTML 1.0 Strict (oder seit XHTML 1.0 allgemein, bin mir nicht ganz sicher) gibt es das target Attribut nicht mehr ;)
 
there is no attribute "target".
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.
ich glaub das ist selbsterklärend, oder?
aber ich schreibs trotzdem nochmal:
für XHTML gibt es kein "target=" mehr, wenn du es nutzen willst und valide bleiben willst, dann musst du "XHTML Transitional" nehmen, denn du nutzt "XHTML Strict"

MfG kbot

Edit: zu langsam ;)
 
hmmm und wie definiere ich Links dann die in einem neuen Fenster geöffnet werden sollen ?
 
Alternativ könnte man es so machen:
PHP:
<a href="https://www.styleshout.com/" onclick="window.open(this.href); return false;">styleshout</a>
setzt aber halt voraus das der User JS aktiv hat.
 
hmmm, das is ja n bissl blöd.
Ich werd dann mal schauen ob ich kbot's Vorschlag umsetze oder den von dir schulz.

Danke erstmal :)
 
also ab CSS3 kannst du das target auch per CSS bestimmen, aber bis das mal soweit ist, das dauert ;)
 
Normalerweise bestimmt sowieso der Webclient, wo er welchen Link öffnen will, von daher ist es wohl nicht erforderlich, dem Benutzer irgendwas mit einem target-Attribut aufdrängen zu wollen.
 
ich habs jetzt so gemacht, dass ich das Target-Attribut komplett rausgenommen hab.