diff options
| author | Florian Merz <me@fiji-flo.de> | 2021-02-11 14:45:38 +0100 |
|---|---|---|
| committer | Florian Merz <me@fiji-flo.de> | 2021-02-11 14:45:38 +0100 |
| commit | 4ab365b110f2f1f2b736326b7059244a32115089 (patch) | |
| tree | c3c7c0219f728ade49a78c238c51cc0c8d06ebd6 /files/de/web/css/class_selectors/index.html | |
| parent | 8260a606c143e6b55a467edf017a56bdcd6cba7e (diff) | |
| download | translated-content-4ab365b110f2f1f2b736326b7059244a32115089.tar.gz translated-content-4ab365b110f2f1f2b736326b7059244a32115089.tar.bz2 translated-content-4ab365b110f2f1f2b736326b7059244a32115089.zip | |
unslug de: move
Diffstat (limited to 'files/de/web/css/class_selectors/index.html')
| -rw-r--r-- | files/de/web/css/class_selectors/index.html | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/files/de/web/css/class_selectors/index.html b/files/de/web/css/class_selectors/index.html new file mode 100644 index 0000000000..eafd714a05 --- /dev/null +++ b/files/de/web/css/class_selectors/index.html @@ -0,0 +1,76 @@ +--- +title: Klassenselektoren +slug: Web/CSS/Klassenselektoren +tags: + - CSS + - CSS Referenz + - Einsteiger + - Selektoren +translation_of: Web/CSS/Class_selectors +--- +<div>{{CSSRef("Selectors")}}</div> + +<p>In einem HTML Dokument matchen CSS Klassenselektoren ein Element basierend auf den Inhalten des {{htmlattrxref("class")}} Attributs des Elements. Das class Attribut ist definiert als eine durch Leerzeichen getrennte Liste von Einträgen, wobei einer dieser Einträge exakt auf den Klassennamen des angegebenen Selektors passen muss.</p> + +<h2 id="Syntax">Syntax</h2> + +<pre class="syntaxbox">.classname { <em>style properties</em> }</pre> + +<p>Beachte, dass dies äquivalent zu folgendem {{cssxref("Attributselektoren", "Attributselektor")}} ist:</p> + +<pre class="syntaxbox">[class~=classname] { <em>style properties</em> }</pre> + +<h2 id="Beispiel">Beispiel</h2> + +<h3 id="CSS">CSS</h3> + +<pre class="brush: css">span.classy { + background-color: DodgerBlue; +} +</pre> + +<h3 id="HTML">HTML</h3> + +<pre class="brush: html"><span class="classy">Hier ist ein Span mit Text.</span> +<span>Hier ist ein weiterer.</span> +</pre> + +<p>{{EmbedLiveSample('Beispiel', 200, 50)}}</p> + +<h2 id="Spezifikationen">Spezifikationen</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Spezifikation</th> + <th scope="col">Status</th> + <th scope="col">Kommentar</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName('CSS4 Selectors', '#class-html', 'class selectors')}}</td> + <td>{{Spec2('CSS4 Selectors')}}</td> + <td>Keine Änderungen</td> + </tr> + <tr> + <td>{{SpecName('CSS3 Selectors', '#class-html', 'class selectors')}}</td> + <td>{{Spec2('CSS3 Selectors')}}</td> + <td> </td> + </tr> + <tr> + <td>{{SpecName('CSS2.1', 'selector.html#class-html', 'child selectors')}}</td> + <td>{{Spec2('CSS2.1')}}</td> + <td> </td> + </tr> + <tr> + <td>{{SpecName('CSS1', '#class-as-selector', 'child selectors')}}</td> + <td>{{Spec2('CSS1')}}</td> + <td>Ursprüngliche Definition</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_Kompatibilität">Browser Kompatibilität</h2> + +{{Compat("css.selectors.class")}} |
