Supportnet Computer
Planet of Tech

Supportnet / Forum / Webseiten/HTML

Was will mir diese Fehlermeldung sagen?





Frage

hallo zusammen, überprüfe gerade meine seite auf XHTML 1.0 Transitional validität. habe auf der getesteten seite 3 errors. verstehe aber nicht wirklich wie ich diese beheben kann. vielleicht kann sie einer von euch besser deuten und mir beibringen was sie mir sagen will... [b]error[/b] Error Line 40 column 36: there is no attribute "background". <td height="100" Background= "Bilder/header.jpg"></td> 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. Danke

Antwort 1 von Roro

´n Abend!

Das heißt so viel wie, dass du einer Tabellenspalte keinen Hintergrund mit dem Attribut background zuweisen darfst, das ist nicht standardkonform.
Du kannst das umgehen, indem du CSS benutzt. Ersetze einfach das background=...
durch
style="background-image:url(Bilder/header.jpg)"


Weitere nützliche Tipps zum Thema findest du bei SelfHTML - Hintergründe in HTML und SelfHTML - Hintergründe mit CSS.

Antwort 2 von beginner81

@Roro

super...vielen dank, werd das gleich mal probieren!
warum ist denn das attribut "height" nicht konform?


error
# Error Line 43 column 32: there is no attribute "height".

<table width="740" height="370" border="0" align="center" cellpadding="0"

Antwort 3 von otimac

hai,
die tabellenhoehe ergibt sich normalerweise aus dem inhalt
um die tabelle zu gestalten verwende css

cu

Antwort 4 von sutadur

Das ist ganz ähnlich. So wie es bei Tabellen standardkonform kein Attribut "background" gibt, gibt es auch kein Attribut "height".

Antwort 5 von rfb

Diese Layout-Attribute in HTML-Elementen, die irgendwann mal eingeführt wurden, sind inzwischen auf der "Abschussliste", da das W3C jetzt streng auf Trennung von Inhalt (HTML) und Layout (CSS) setzt.

Daher solltest du solche Attribute vermeiden und stattdessen CSS nutzen, zumal dies sowieso wesentlich flexibler zu gestalten ist.

Ich möchte kostenlos eine Frage an die Mitglieder stellen:


Ähnliche Themen:


Suche in allen vorhandenen Beiträgen: