W3C Markup Validation mit <em> & <p>

  • Also ich die Validator beschweren sich immer, und das liegt daran:

    Aufgabe:

    1. Schreibe einen Text
    2. Schreibe den Text kursiv.
    3. Füge der Übersichtlichkeit halber Zeilenumbrüche hinzu.

    1, 2 und 3, so sieht das dann im Wordpress-Editor aus:

    Zitat

    <blockquote>[COLOR=Lime]<em>[/COLOR] Text, noch mehr Text. Text, noch mehr Text.Text, noch mehr Text.Text, noch mehr Text. Es folgt ein Zeilenumbruch.
    Weiter im Text. Text, noch mehr Text.Text, noch mehr Text.Text, noch mehr Text.Text, noch mehr Text.Gleich lassen wir eine Zeile frei.

    Text, noch mehr Text. Text, noch mehr Text. Und so weiter. [COLOR=Lime]</em>[/COLOR]</blockquote>

    Soweit so gut, schauen wir jetzt aber in den Quelltext, dann lesen wir Folgendes:

    Zitat

    <blockquote><p[COLOR=Red][COLOR=Black]>[/COLOR]<[/COLOR]em> Text, noch mehr Text. Text, noch mehr Text.Text, noch mehr Text.Text, noch mehr Text. Es folgt ein Zeilenumbruch.<br />
    Weiter im Text. Text, noch mehr Text.Text, noch mehr Text.Text, noch mehr Text.Text, noch mehr Text.Gleich lassen wir eine Zeile frei.</p[COLOR=Red]>[/COLOR]
    <p>Text, noch mehr Text. Text, noch mehr Text. Und so weiter. </em[COLOR=Red][COLOR=Red]>[/COLOR]<[/COLOR]/p></blockquote>

    Problem ist wohl, dass Wordpress zwei Zeilenwechsel zu 'nem Abschnitt umwandelt (statt 2x <br />), das <em> müsste eigentlich innerhalb des <p> wieder geschlossen werden. Was kann man machen, um es dem Validator recht zu machen?


    • Anzeige

    Hallo!

    Wenn du gerade an deiner Website arbeitest oder dein aktuelles Hosting überdenkst: Wir betreiben mit NetzLiving eine Hosting-Plattform, die speziell auf Performance, Sicherheit und einfache Verwaltung ausgelegt ist.

    • ✔️ Schnelle Ladezeiten (optimiert für WordPress & Co.)
    • ✔️ Deutsche Server & DSGVO-konform
    • ✔️ Persönlicher Support (kein 0815-Ticket-System)

    Mehr erfahren

  • Ja, der Einfall kam mir auch, nur ich will's ja eben nicht immer kursiv haben, sondern je nach Inhalt des Blockquotes, ob Zitat oder nicht ...


  • Code
    <blockquote [COLOR=Red]class="zitat"[/COLOR]>Text, noch mehr Text. Text, noch mehr Text.Text, noch mehr Text.Text, noch mehr Text. Es folgt ein Zeilenumbruch.
    Weiter im Text. Text, noch mehr Text.Text, noch mehr Text.Text, noch mehr Text.Text, noch mehr Text.Gleich lassen wir eine Zeile frei.
     
    Text, noch mehr Text. Text, noch mehr Text. Und so weiter. </blockquote>

    mit style.css folgend:

    Code
    blockquote.[COLOR=Red]zitat[/COLOR] {
    [size=10]  font-style: italic;
    [/SIZE]}

    dann werden nur von dir als zitat gekennzeichnet blockquotes kursiv alle normalen blockquotes sind gemäß deiner sonstigen Definition.

  • <p> Problem

    Guter Tipp, aber es geht wieder, diese [COLOR="Red"]<p>[/COLOR]s nerven voll, überall hängen sie sich rein, natürlich auch in die Listen, aber egal wo es Fehler ausspuckt, es ist immer das [COLOR="Red"]P[/COLOR] Schuld, welches noch nie was von W3C gehört hat.

    Also anderer Lösungsansatz, wie bekomme ich es hin, das wordpress statt [COLOR="Red"]<p></p>[/COLOR] mir zwei [COLOR="Lime"]<br />[/COLOR] reinsetzt?


Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!