Axel Richter: onmouseover %Script; #IMPLIED

Beitrag lesen

Hallo Robert,

Laut http://www.wer-weiss-was.de/theme3/article28465.html darfst du jetzt nach einer sehr umfangreichen Antwort ein dankeschön erwarten.
Also:

Danke

Willst Du mir damit sagen, dass Du meinen Ausführungen nicht folgen konntest? ;-)) Ja, eine DTD lesen _ist_ anspruchsvoll.

onmouseover %Script;       #IMPLIED //<<- INSIDER SPAß :)

Ich nehme mal an, dass das hier bedeutet das man nicht gezwungen ist einen nur script zu verwenden.

Nein. Das ist aus der DTD kopiert.
http://www.w3.org/TR/html4/sgml/dtd.html#events

Wie man eine DTD liest steht hier: http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.3.

Das "onmouseover" ist ein Attribut. Also:
3.3.4 Attribute declarations
The <!ATTLIST keyword begins the declaration of attributes that an element may take. It is followed by the name of the element in question, a list of attribute definitions, and a closing >. Each attribute definition is a triplet that defines:

The name of an attribute.
The type of the attribute's value or an explicit set of possible values. Values defined explicitly by the DTD are case-insensitive. Please consult the section on basic HTML data types for more information about attribute value types.
Whether the default value of the attribute is implicit (keyword "#IMPLIED"), in which case the default value must be supplied by the user agent (in some cases via inheritance from parent elements); always required (keyword "#REQUIRED"); or fixed to the given value (keyword "#FIXED"). Some attribute definitions explicitly specify a default value for the attribute.

Das #IMPLIED legt also fest, dass der Standardinhalt des Attributs "onmouseover" vom user agent (dem Browser) vorgegeben wird. Es _muss_ also nicht _immer_ explizit angegeben werden.

Es gibt Attribute, die _immer_ angegeben werden müssen:
<!ATTLIST IMG
  %attrs;                              -- %coreattrs, %i18n, %events --
  src         %URI;          #REQUIRED -- URI of image to embed --
  alt         %Text;         #REQUIRED -- short description --
  ...
  >

Ein IMG-Element _muss_ also die Attribute src _und_ alt haben.
<img> - ist falsch
<img src="bild.gif"> - ist falsch
<img src="bild.gif" alt="Ein Bild"> - ist korrekt.

viele Grüße

Axel