document type ....

Status
Nicht offen für weitere Antworten.

Loomis

Mitglied Bunt
Mein Doctype im moment:
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Hier der Code:

HTML:
<ul><strong>Überschrift</strong>
<li>Punkt 1</li>
<li>Punkt 2</li>
<li>Punkt 3</li>
<li>Punkt 4</li>
</ul>

Fehlermeldungen bekomme ich folgende:
Code:
line 63 column 11 - Fehler: document type does not allow element "strong" here; assuming missing "li" start-tag

line 64 column 3 - Fehler: document type does not allow element "li" here; missing one of "ul", "ol" start-tag

line 65 column 3 - Fehler: document type does not allow element "li" here; missing one of "ul", "ol" start-tag

line 66 column 3 - Fehler: document type does not allow element "li" here; missing one of "ul", "ol" start-tag

line 67 column 3 - Fehler: document type does not allow element "li" here; missing one of "ul", "ol" start-tag

Kann mir wer sagen was im DocType falsch ist?

// edit: <b> geht auch nicht
 
Zuletzt bearbeitet:
Es steht doch da...
Code:
document type does not allow element "strong" here; assuming missing "li" start-tag

Die Listen <ul> bzw. <ol> dürfen nur <li>-Elemente als Kindelemente haben, <strong>(und alles andere ausser <li>) ist dort, wo <strong> jetzt steht, nicht zulässig.
 
Innerhalb von <ul> sind nur <li> -Elemente erlaubt. Die Vorgabe einer "Überschrift" so wie du das willst, verursacht den Fehler - nicht der DocType
 
Wenn du damit folgendes meinst:

Code:
<ul>Überschrift
<li>Punkt 1</li>
<li>Punkt 2</li>
<li>Punkt 3</li>
<li>Punkt 4</li>
</ul>

Auch das entspricht nicht dem Strict-Standard. Innerhalb von <ul> oder <ol> sind nur <li>-Elemente erlaubt. Punkt.
 
Hi,

ein (valide) Möglichkeit wäre eine verschachtelte Liste:

Code:
<ul>
    <li>Überschrift
        <ul>
            <li>Punkt 1</li>
            <li>Punkt 2</li>
            <li>Punkt 3</li>
            <li>Punkt 4</li>
        </ul>
    </li>
</ul>
Code:
ul li { font-weight:bold; }
ul li ul li { font-weight:normal; }
 
So könnte das auch gehen:
HTML:
<h4>Überschrift</h4>
<ul>
	<li>Punkt 1</li>
	<li>Punkt 2</li>
	<li>Punkt 3</li>
	<li>Punkt 4</li>
</ul>

Code:
h4 { text-indent:35px; }

Nur ist da dann ein Abstand zwischen <h4> und <ul>. (Siehe Anhang)

Kann man das etwas zusammenziehen?
 

Anhänge

  • bild1.png
    bild1.png
    600 Bytes · Aufrufe: 680
Status
Nicht offen für weitere Antworten.
Zurück