Quelle: Wikipedia
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V3.1//EN">
<article>
<sect1 id="introduction">
<title>Hello world introduction</title>
<para>
Hello world!
</para>
</sect1>
</article>
Quelle: newbiedoc.sourceforge.net
Quelle: w3.org
<!-- Ich bin ein Kommentar -->
<!-- Start / Ende -->
Ein <strong>richtig</strong> schöner Tag.
<!-- Selbstschließend (void elements) -->
<hr /> oder <hr>
<!-- Schachtelung -->
<h1>Die <strong>Chance</strong> des Tages</h1>
<!-- Schlüssel-Wert-Paar -->
<input value="Goku" placeholder="Name">
<!-- binäre Attribute (kann Wert haben, muss aber nicht) -->
<input disabled>
<!-- Mehrere Werte als leerzeichengetrennte Liste -->
<input class="aktiv obligatorisch hervorgehoben">
<!-- Custom Data Attributes -->
<span class="notifications" data-count="3">Benachrichtigungen</span>
ä ß
"
&
< >
☃
body { font: 300% monospace; }
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<title> … </title>
</head>
<body>
…
</body>
</html>
Quelle: @SlexAxton
<!-- Zusatzinformationen zum Dokument -->
<meta charset="utf-8"> <!-- Kodierung -->
<meta name="description" content="Hallo Google-Ergebnis-Liste.">
<meta http-equiv="refresh" content="5; URL=http://andere.domain.de/">
<title>Einführung in HTML</title> <!-- Dokumententitel -->
<!-- Verweis auf externe Ressource -->
<link rel="stylesheet" href="style.css">
<link rel="shortcut icon" href="favicon.ico"> <!-- Nicht nötig -->
<link rel="alternate" type="application/atom+xml" href="feed.atom">
Quelle: W3C – Content Models – Mehr: MDN – Content categories
Name | Beschreibung |
---|---|
Metadata | Definiert Präsentation oder Verhalten des restlichen Inhalts. |
Sectioning | Unterteilt semantisch. Definiert Scope von Headern und Footern. |
Heading | Definiert den Kopf eines Bereichs. |
Phrasing | Zeichnet den Text des Inhalts aus. |
Embedded | Bindet andere Ressourcen ein. |
Interactive | Inhalt, der zur Benutzer-Interaktion gedacht ist. |
<h1>Eins</h1>
<h2>Zwei</h2>
<h3>Drei</h3>
<h4>Vier</h4>
<h5>Fünf</h5>
<h6>Sechs</h6>
Das muss <strong>dringend</strong> erledigt werden.<br>
<em>Du</em> hast doch gesagt: <q>Machste eh nicht.</q><br>
Das Wort <i>das</i> ist ein Artikel.<br>
<small>Copyright <del>2023</del> 2024 Foo Inc.</small><br>
<code>public static void <span class="function">main</span>(String[] args)</code>
body { font-size: 150%; line-height: 1.5; }
Der Flieger nach <abbr title="Derby Field Airport, Lovelock, USA">LOL</abbr> wird am <time datetime="2014-10-01 17:01">1. Oktober um 17.01 Uhr</time> starten.
body { font-size: 150%; line-height: 1.5; }
<p>Ich bin ein eigener Absatz.</p> <p> Ich auch. </p>
<pre> Mir ist jedes
Leerzeichen
wichtig.</pre>
body { font-size: 150%; line-height: 1.5; }
<img src="wikipedia.png" title="Wikipedia">
<img src="nischt.jpg" width="135" height="155" alt="Wikipedia">
<a href="https://de.wikipedia.org/">Wikipedia</a>
body {
display: flex;
justify-content: space-around;
align-items: center;
}
* { font-size: 23px; }
<a href="http://wikipedia.org/"><img src="wikipedia.png"></a>
<a href="http://wikipedia.org/" target="_blank">Wikipedia</a> <small>(öffnet neuen Tab)</small>
* { font-size: 23px; }
a:first-child {
display: block;
margin-bottom: 23px;
}
<figure>
<img src="wikipedia.png" alt="Wikipedia">
<figcaption>Die freie Enzyklopädie</figcaption>
</figure>
body {
display: flex;
justify-content: space-around;
align-items: center;
}
* { font-size: 23px; }
<iframe
src="https://beier.f4.htw-berlin.de/"
height="321" width="357"
frameborder="0">
Kann keine iFrames.
</iframe>
<ul>
<li>Tick</li>
<li>Trick</li>
<li>Track</li>
</ul>
<ol>
<li>Schlafen</li>
<li>Essen</li>
<li>Lernen</li>
</ol>
<dl>
<dt>HTTP</dt>
<dd>Hypertext Transfer Protocol</dd>
<dt>HTML</dt>
<dd>Hypertext Markup Language</dd>
</dl>
* { font-size: 23px; }
<table>
<tr>
<th>Stadt</th>
<th>Land</th>
<th>Fluss</th>
</tr>
<tr>
<td>Berlin</td>
<td>Deutschland</td>
<td>Spree</td>
</tr>
<tr>
<td>London</td>
<td>England</td>
<td>Themse</td>
</tr>
</table>
<br><br>
<a href="http://css-tricks.com/complete-guide-table-element/">A Complete Guide to the Table Element</a>
* {
font-size: 23px;
text-align: left;
padding: 0 10px 10px 0;
}
<form action="index.php" method="POST">
<input type="text" name="stadt" placeholder="Stadt">
<label for="nl">Newsletter?</label>
<input id="nl" type="checkbox" name="nl" checked>
<input type="number" name="alter" value="42">
<button type="submit">Absenden</button>
</form>
* { font-size: 20px; }
<input type="password">
<input type="email">
<input type="tel">
<input type="url">
<input type="date">
<input type="week">
<input type="month">
<input type="time">
<input type="color">
<input type="number">
<input type="range">
<input type="search">
* { font-size: 17px; }
input {
display: block;
width: 100%;
}
<input autofocus>
<input inputmode="numeric">
<input autocomplete="off">
<input autocomplete="email">
<input autocomplete="one-time-code">
<input disabled value="nein">
<input readonly value="nur zum Kopieren">
<input minlength="3" maxlength="7">
<input required>
<input pattern="^[0-9]{5}$">
<input tabindex="-1">
* { font-size: 17px; }
input {
display: block;
width: 100%;
}
input:focus:valid { background-color: #caecae }
input:focus:invalid { background-color: #ffcece }
<select name="produkte">
<optgroup label="Defensiv">
<option>Schild</option> <option>Rüstung</option>
</optgroup>
<optgroup label="Offensiv">
<option>Schwert</option> <option selected>Bogen</option>
</optgroup>
<optgroup label="Premium" disabled>
<option>Heiltrank</option> <option>Tarnmantel</option>
</optgroup>
</select>
body { text-align: center; }
<header> <h1>Schau an was ich esse</h1> <nav> (...) </nav> </header>
<div> Bedeutungslose Hülle </div>
<section>
<h2>Wochenmahl</h2>
<article> <h3>Nudeln</h3> <p>Nudeln mit Soße</p> </article>
<aside> <a href="/archiv">Archiv des letzten Monats</a> </aside>
</section>
<footer> <p>Lirum larum, Löffelstiel.</p> </footer>
id
verlinkbar
class
title
Quelle: SirPepe