{"id":1572,"date":"2021-04-10T14:21:02","date_gmt":"2021-04-10T12:21:02","guid":{"rendered":"https:\/\/ekiwi.de\/?p=1572"},"modified":"2021-04-12T20:48:21","modified_gmt":"2021-04-12T18:48:21","slug":"html-ausklappelemente-mit-dem-details-tag","status":"publish","type":"post","link":"https:\/\/ekiwi.de\/index.php\/1572\/html-ausklappelemente-mit-dem-details-tag\/","title":{"rendered":"HTML: Ausklappelemente mit dem Details-Tag"},"content":{"rendered":"<p>Der Details-Tag erlaubt schnell und einfach Ausklappelemente in Webseiten zu erstellen.<\/p>\n<p><!--more--><\/p>\n<p>Ausklappelemente f\u00fcr Detailinformationen lassen sich in HTML schnell und einfach mit dem &#8222;detail&#8220; Tag erstellen. Klickt der Anwender auf das Element, wird es aufgeklappt und der Inhalt wird sichtbar.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/wp-content\/uploads\/2021\/04\/klappen.gif\" alt=\"\" width=\"656\" height=\"362\" class=\"alignnone size-full wp-image-1573\" \/><\/p>\n<p>M\u00f6glich und einfach umsetzbar macht dies der folgende Code:<\/p>\n<pre>\r\n&lt;details style=&quot;background: #cccccc; border: 1px solid #000; margin-bottom: 1.5rem;&quot;&gt;\r\n    &lt;summary style=&quot;padding: 1rem; background: #222222; color: #fff; cursor: pointer;&quot;&gt;\r\n        Ich bin die \u00dcberschrift. Klick mich an!\r\n    &lt;\/summary&gt;\r\n    &lt;div style=&quot;padding: 1rem 1rem 1px 1rem;&quot;&gt;\r\n        &lt;p&gt;Hier kommt Inhalt, der erst nach dem Ausklappen sichtbar ist.&lt;\/p&gt;\r\n        &lt;img src=&quot;https:\/\/ekiwi.de\/wp-content\/uploads\/2018\/03\/logo_blog_header-2.png\">\r\n    &lt;\/div&gt;\r\n&lt;\/details&gt;<\/pre>\n<p>Der Code ist fast selbsterkl\u00e4rend. Das Element wird vom &#8222;detail&#8220;-Tag umschlossen. Die &#8222;summary&#8220; enth\u00e4lt die \u00dcberschrift und das &#8222;div&#8220;-Element enth\u00e4lt den Inhalt, welcher nach dem Aufklappen sichtbar ist.<\/p>\n<p><a href=\"https:\/\/ekiwi.de\/tryit\/?id=158\" target=\"_blank\" rel=\"noopener\">Hier geht es zum Beispiel<\/a><\/p>\n\n<div class=\"aawp\">\n\n            \n            \n<div class=\"aawp-product aawp-product--horizontal aawp-product--bestseller aawp-product--ribbon\"  data-aawp-product-asin=\"3367102334\" data-aawp-product-id=\"5226\" data-aawp-tracking-id=\"ekiwide0b-21\" data-aawp-product-title=\"Einstieg in HTML und CSS  Barrierefreie und responsive Webseiten erstellen mit HTML und CSS \u2013 ganz ohne Vorwissen! Ausgabe 2024\">\n\n    <span class=\"aawp-product__ribbon aawp-product__ribbon--bestseller\">Bestseller Nr. 1<\/span>\n    <div class=\"aawp-product__thumb\">\n        <a class=\"aawp-product__image-link\"\n           href=\"https:\/\/www.amazon.de\/dp\/3367102334?tag=ekiwide0b-21&linkCode=ogi&th=1&psc=1&keywords=buch%20html%20css\" title=\"Einstieg in HTML und CSS: Barrierefreie und...\" rel=\"nofollow noopener sponsored\" target=\"_blank\">\n            <img decoding=\"async\" class=\"aawp-product__image\" src=\"https:\/\/m.media-amazon.com\/images\/I\/51Ufw8HePtL._SL160_.jpg\" alt=\"Einstieg in HTML und CSS: Barrierefreie und...\"  \/>\n        <\/a>\n\n            <\/div>\n\n    <div class=\"aawp-product__content\">\n        <a class=\"aawp-product__title\" href=\"https:\/\/www.amazon.de\/dp\/3367102334?tag=ekiwide0b-21&linkCode=ogi&th=1&psc=1&keywords=buch%20html%20css\" title=\"Einstieg in HTML und CSS: Barrierefreie und...\" rel=\"nofollow noopener sponsored\" target=\"_blank\">\n            Einstieg in HTML und CSS: Barrierefreie und...        <\/a>\n        <div class=\"aawp-product__description\">\n            <ul><li>M\u00fcller, Peter(Autor)<\/li><\/ul>        <\/div>\n    <\/div>\n\n    <div class=\"aawp-product__footer\">\n\n        <div class=\"aawp-product__pricing\">\n            \n                            <span class=\"aawp-product__price aawp-product__price--current\"><\/span>\n            \n                    <\/div>\n\n                <a class=\"aawp-button aawp-button--buy aawp-button--icon aawp-button--icon-black\" href=\"https:\/\/www.amazon.de\/dp\/3367102334?tag=ekiwide0b-21&#038;linkCode=ogi&#038;th=1&#038;psc=1&#038;keywords=buch%20html%20css\" title=\"Bei Amazon kaufen\" target=\"_blank\" rel=\"nofollow noopener sponsored\">Bei Amazon kaufen<\/a>\n            <\/div>\n\n<\/div>\n\n            \n            \n<div class=\"aawp-product aawp-product--horizontal aawp-product--bestseller aawp-product--ribbon\"  data-aawp-product-asin=\"3836297280\" data-aawp-product-id=\"5225\" data-aawp-tracking-id=\"ekiwide0b-21\" data-aawp-product-title=\"HTML und CSS  Das umfassende Handbuch zum Lernen und Nachschlagen Inkl JavaScript Responsive Webdesign React und Angular u v m.\">\n\n    <span class=\"aawp-product__ribbon aawp-product__ribbon--bestseller\">Bestseller Nr. 2<\/span>\n    <div class=\"aawp-product__thumb\">\n        <a class=\"aawp-product__image-link\"\n           href=\"https:\/\/www.amazon.de\/dp\/3836297280?tag=ekiwide0b-21&linkCode=ogi&th=1&psc=1&keywords=buch%20html%20css\" title=\"HTML und CSS: Das umfassende Handbuch zum Lernen...\" rel=\"nofollow noopener sponsored\" target=\"_blank\">\n            <img decoding=\"async\" class=\"aawp-product__image\" src=\"https:\/\/m.media-amazon.com\/images\/I\/51etBIPDtcL._SL160_.jpg\" alt=\"HTML und CSS: Das umfassende Handbuch zum Lernen...\"  \/>\n        <\/a>\n\n            <\/div>\n\n    <div class=\"aawp-product__content\">\n        <a class=\"aawp-product__title\" href=\"https:\/\/www.amazon.de\/dp\/3836297280?tag=ekiwide0b-21&linkCode=ogi&th=1&psc=1&keywords=buch%20html%20css\" title=\"HTML und CSS: Das umfassende Handbuch zum Lernen...\" rel=\"nofollow noopener sponsored\" target=\"_blank\">\n            HTML und CSS: Das umfassende Handbuch zum Lernen...        <\/a>\n        <div class=\"aawp-product__description\">\n            <ul><li>Wolf, J\u00fcrgen(Autor)<\/li><\/ul>        <\/div>\n    <\/div>\n\n    <div class=\"aawp-product__footer\">\n\n        <div class=\"aawp-product__pricing\">\n            \n                            <span class=\"aawp-product__price aawp-product__price--current\"><\/span>\n            \n                    <\/div>\n\n                <a class=\"aawp-button aawp-button--buy aawp-button--icon aawp-button--icon-black\" href=\"https:\/\/www.amazon.de\/dp\/3836297280?tag=ekiwide0b-21&#038;linkCode=ogi&#038;th=1&#038;psc=1&#038;keywords=buch%20html%20css\" title=\"Bei Amazon kaufen\" target=\"_blank\" rel=\"nofollow noopener sponsored\">Bei Amazon kaufen<\/a>\n            <\/div>\n\n<\/div>\n\n    \n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Der Details-Tag erlaubt schnell und einfach Ausklappelemente in Webseiten zu erstellen.<\/p>\n","protected":false},"author":1,"featured_media":1344,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[5],"tags":[72,4,172],"class_list":["post-1572","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hmtl","tag-anleitung","tag-html","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/posts\/1572","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/comments?post=1572"}],"version-history":[{"count":0,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/posts\/1572\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/media\/1344"}],"wp:attachment":[{"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/media?parent=1572"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/categories?post=1572"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/tags?post=1572"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}