HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Any URLs added here will be added as <link>
s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
Any URL's added here will be added as <script>
s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
Search for and use JavaScript packages from npm here. By selecting a package, an import
statement will be added to the top of the JavaScript editor for this package.
Using packages here is powered by esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<body>
<h1>Create an Accordion with HTML Elements "details" and "summary"</h1>
<h2>Open and Close Completely without JavaScript or the CSS pseudo class ":target"</h2>
<div class="details-wrapper">
<details>
<summary>1. The HTML Element "details"</summary>
<div class="details-content">
<p>The HTML element "details" causes contents to be opened and closed again.<br> For this it is sufficient to write the following code:</p>
<!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #007700"><details><p></span>Collapsible contents<span style="color: #007700"></p></details></span>
</pre></div>
<br>
<p>However, you will get an error message if you test the HTML code in the <a href="https://validator.w3.org/#validate_by_input" title="" target="_blank">W3C-Validator</a>:</p>
<p><i class="warning">Error: Element details is missing a required instance of child element summary.</i></p>
<p>So in the next step I add the required HTML element "summary".</p>
</div><!-- end details-content -->
</details>
<details>
<summary>2. Accordion with "details", "summary" and "p"</summary>
<div class="details-content">
<p>I now insert the required HTML element "summary" into "details". This makes "summary" the child element of "details".</p>
<p>For example, if the HTML element "summary" is followed by a paragraph, this paragraph becomes the collapsible target. The appropriate code is:</p>
<!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #007700"><details></span>
<span style="color: #007700"><summary></span>Title or heading<span style="color: #007700"></summary></span>
<span style="color: #007700"><p></span>Here comes the collapsible text.<span style="color: #007700"></p></span>
<span style="color: #007700"></details></span>
</pre></div>
<br>
<p>This code passes <a href="https://validator.w3.org/#validate_by_input" target="_blank">the validation</a> without complaint.</p>
</div><!-- end details-content -->
</details>
<details>
<summary>3. Design Open and Closed Accordion Differently</summary>
<div class="details-content">
<p>The HTML element "details" contains the attribute "open", with which you can set the respective status via CSS.</p>
<figure>
<img src="https://www.imarketinx.de/artikel/pics/html-details/details-open.png" alt="Status 'open' in HTML element 'details" title="The developer tool 'Inspector' in Firefox shows the status 'open'">
<figcaption>The status "open" in the HTML element "details" - here in the Firefox tool "inspector".</figcaption>
</figure>
<p>If the accordion is closed, the font should be normal, if it is open, the font of the title should be italic. Therefore I use CSS to address the attribute "open" of the HTML element "details". The CSS code for it:</p>
<!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #888888">/* Styling the font-style of the summary title */</span>
<span style="color: #007700">details</span><span style="color: #333333">[</span><span style="color: #007700">open</span><span style="color: #333333">]</span> <span style="color: #007700">summary</span> {
<span style="color: #008800; font-weight: bold">font-style</span><span style="color: #333333">:</span> <span style="color: #008800; font-weight: bold">italic</span>;
}
</pre></div>
<p>Using this accordion as an example, you can notice that the font changes from <i>normal</i> to <i>italic</i> as soon as the accordion element is opened.</p>
</div><!-- end details-content -->
</details>
<details>
<summary>4. Displaying Multiple Accordion Elements</summary>
<div class="details-content">
<p>If more than one element that can be opened is to be placed on the website, it is not sufficient to just put new "summary elements" under a "details element". For each expandable element, a "detail element" must be written into the HTML code:</p>
<!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #007700"><details></span>
<span style="color: #007700"><summary></span>Title or Heading<span style="color: #007700"></summary></span>
<span style="color: #007700"><p></span>Here comes the collapsible text.<span style="color: #007700"></p></span>
<span style="color: #007700"></details></span>
<span style="color: #007700"><details></span>
<span style="color: #007700"><summary></span>Title or Heading<span style="color: #007700"></summary></span>
<span style="color: #007700"><p></span>Here comes the collapsible text.<span style="color: #007700"></p></span>
<span style="color: #007700"></details></span>
<span style="color: #007700"><details></span>
<span style="color: #007700"><summary></span>Title or Heading<span style="color: #007700"></summary></span>
<span style="color: #007700"><p></span>Here comes the collapsible text.<span style="color: #007700"></p></span>
<span style="color: #007700"></details></span>
</pre></div>
<br>
</div><!-- end details-content -->
</details>
<details>
<summary>5. Replace Triangle with Plus and Minus</summary>
<div class="details-content">
<p>If you don't like the triangle as a status indicator, you can easily replace it with a picture or another character. Before I add some CSS to make the accordion look like an accordion:</p>
<!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #888888">CSS-Code</span>
<span style="color: #333333">*</span> {
box<span style="color: #333333">-</span>sizing<span style="color: #333333">:</span> <span style="color: #008800; font-weight: bold">border</span><span style="color: #333333">-</span>box;
}
<span style="color: #007700">img</span> {
<span style="color: #008800; font-weight: bold">max-width</span><span style="color: #333333">:</span> <span style="color: #6600EE; font-weight: bold">100</span><span style="color: #333333">%</span>;
}
<span style="color: #BB0066; font-weight: bold">.details-wrapper</span> {
<span style="color: #008800; font-weight: bold">width</span><span style="color: #333333">:</span> <span style="color: #6600EE; font-weight: bold">75</span>vw;
<span style="color: #008800; font-weight: bold">margin</span><span style="color: #333333">:</span> <span style="color: #6600EE; font-weight: bold">0</span> <span style="color: #008800; font-weight: bold">auto</span>;
<span style="color: #008800; font-weight: bold">background-color</span><span style="color: #333333">:</span> <span style="color: #6600EE; font-weight: bold">#E5E5E5</span>;
box<span style="color: #333333">-</span>shadow<span style="color: #333333">:</span><span style="color: #6600EE; font-weight: bold">0</span> <span style="color: #6600EE; font-weight: bold">0</span> <span style="color: #6600EE; font-weight: bold">1px</span> <span style="color: #6600EE; font-weight: bold">2px</span> <span style="color: #6600EE; font-weight: bold">#BFBFBF</span>;
}
<span style="color: #007700">details</span> {
<span style="color: #008800; font-weight: bold">padding</span><span style="color: #333333">:</span> <span style="color: #333333">.</span><span style="color: #6600EE; font-weight: bold">5</span>rem;
<span style="color: #008800; font-weight: bold">font</span><span style="color: #333333">:</span> <span style="color: #6600EE; font-weight: bold">1</span>rem<span style="color: #333333">/</span><span style="color: #6600EE; font-weight: bold">1</span><span style="color: #333333">.</span><span style="color: #6600EE; font-weight: bold">2</span> <span style="color: #008800; font-weight: bold">sans-serif</span>;
}
<span style="color: #007700">summary</span> {
<span style="color: #008800; font-weight: bold">padding</span><span style="color: #333333">:</span> <span style="color: #333333">.</span><span style="color: #6600EE; font-weight: bold">25</span>rem <span style="color: #6600EE; font-weight: bold">1</span>rem;
<span style="color: #008800; font-weight: bold">font</span><span style="color: #333333">:</span> <span style="color: #008800; font-weight: bold">bold</span> <span style="color: #6600EE; font-weight: bold">1</span><span style="color: #333333">.</span><span style="color: #6600EE; font-weight: bold">25</span>rem<span style="color: #333333">/</span><span style="color: #6600EE; font-weight: bold">2</span> <span style="color: #008800; font-weight: bold">sans-serif</span>;
<span style="color: #008800; font-weight: bold">background-color</span><span style="color: #333333">:</span> <span style="color: #007020">steelblue</span>;
<span style="color: #008800; font-weight: bold">border</span><span style="color: #333333">:</span> <span style="color: #008800; font-weight: bold">none</span>;
<span style="color: #008800; font-weight: bold">border</span><span style="color: #333333">-</span>radius<span style="color: #333333">:</span> <span style="color: #6600EE; font-weight: bold">3px</span>;
box<span style="color: #333333">-</span>shadow<span style="color: #333333">:</span> <span style="color: #6600EE; font-weight: bold">0</span> <span style="color: #6600EE; font-weight: bold">-1px</span> <span style="color: #6600EE; font-weight: bold">1px</span> <span style="color: #6600EE; font-weight: bold">1px</span> rgba(<span style="color: #6600EE; font-weight: bold">0</span><span style="color: #333333">,</span><span style="color: #6600EE; font-weight: bold">0</span><span style="color: #333333">,</span><span style="color: #6600EE; font-weight: bold">0</span><span style="color: #333333">,</span><span style="color: #6600EE; font-weight: bold">0</span><span style="color: #333333">.</span><span style="color: #6600EE; font-weight: bold">5</span>);
<span style="color: #008800; font-weight: bold">color</span><span style="color: #333333">:</span><span style="color: #007020">floralwhite</span>;
<span style="color: #008800; font-weight: bold">cursor</span><span style="color: #333333">:</span> <span style="color: #008800; font-weight: bold">pointer</span>;
<span style="color: #888888">/*list-style: none;*/</span> <span style="color: #888888">/* Triangle not shown */</span>
}
<span style="color: #888888">/* Triangle not shown - Style for Webkit-Browser */</span>
<span style="color: #888888">/*summary::-webkit-details-marker {</span>
<span style="color: #888888"> display: none;</span>
<span style="color: #888888">}*/</span>
<span style="color: #007700">summary</span><span style="color: #333333">:</span><span style="color: #555555; font-weight: bold">:before</span> {
<span style="color: #008800; font-weight: bold">padding-right</span><span style="color: #333333">:</span> <span style="color: #333333">.</span><span style="color: #6600EE; font-weight: bold">25</span>rem;
<span style="color: #888888">/*content: '+ ';*/</span> <span style="color: #888888">/* Instead of Triangle closed */</span>
}
<span style="color: #007700">details</span><span style="color: #333333">[</span><span style="color: #007700">open</span><span style="color: #333333">]</span> <span style="color: #007700">summary</span><span style="color: #333333">:</span><span style="color: #555555; font-weight: bold">:before</span> {
<span style="color: #008800; font-weight: bold">padding-right</span><span style="color: #333333">:</span> <span style="color: #333333">.</span><span style="color: #6600EE; font-weight: bold">25</span>rem;
<span style="color: #008800; font-weight: bold">font-style</span><span style="color: #333333">:</span> <span style="color: #008800; font-weight: bold">italic</span>;
<span style="color: #888888">/*content: '- ';*/</span> <span style="color: #888888">/* Instead of Triangle open */</span>
}
<span style="color: #888888">/* Styling the summary in case of open 'details' */</span>
<span style="color: #007700">details</span><span style="color: #333333">[</span><span style="color: #007700">open</span><span style="color: #333333">]</span> <span style="color: #007700">summary</span> {
<span style="color: #008800; font-weight: bold">font-style</span><span style="color: #333333">:</span> <span style="color: #008800; font-weight: bold">italic</span>;
<span style="color: #008800; font-weight: bold">border</span><span style="color: #333333">-</span>radius<span style="color: #333333">:</span> <span style="color: #6600EE; font-weight: bold">3px</span> <span style="color: #6600EE; font-weight: bold">3px</span> <span style="color: #6600EE; font-weight: bold">0</span> <span style="color: #6600EE; font-weight: bold">0</span>;
}
<span style="color: #BB0066; font-weight: bold">.details-content</span> {
<span style="color: #008800; font-weight: bold">margin</span><span style="color: #333333">:</span> <span style="color: #6600EE; font-weight: bold">0</span>;
<span style="color: #008800; font-weight: bold">padding</span><span style="color: #333333">:</span> <span style="color: #333333">.</span><span style="color: #6600EE; font-weight: bold">25</span>rem <span style="color: #6600EE; font-weight: bold">1</span>rem;
<span style="color: #008800; font-weight: bold">background-color</span><span style="color: #333333">:</span> <span style="color: #007020">floralwhite</span>;
<span style="color: #008800; font-weight: bold">border</span><span style="color: #333333">-</span>radius<span style="color: #333333">:</span> <span style="color: #6600EE; font-weight: bold">0</span> <span style="color: #6600EE; font-weight: bold">0</span> <span style="color: #6600EE; font-weight: bold">3px</span> <span style="color: #6600EE; font-weight: bold">3px</span>;
box<span style="color: #333333">-</span>shadow<span style="color: #333333">:</span> <span style="color: #6600EE; font-weight: bold">0</span> <span style="color: #6600EE; font-weight: bold">1px</span> <span style="color: #6600EE; font-weight: bold">1px</span> <span style="color: #6600EE; font-weight: bold">1px</span> rgba(<span style="color: #6600EE; font-weight: bold">0</span><span style="color: #333333">,</span><span style="color: #6600EE; font-weight: bold">0</span><span style="color: #333333">,</span><span style="color: #6600EE; font-weight: bold">0</span><span style="color: #333333">,</span><span style="color: #6600EE; font-weight: bold">0</span><span style="color: #333333">.</span><span style="color: #6600EE; font-weight: bold">5</span>);
<span style="color: #008800; font-weight: bold">color</span><span style="color: #333333">:</span> <span style="color: #007020">steelblue</span>;
}
<span style="color: #BB0066; font-weight: bold">.details-content</span> <span style="color: #007700">p</span> {
<span style="color: #008800; font-weight: bold">font</span><span style="color: #333333">:</span> <span style="color: #6600EE; font-weight: bold">1</span><span style="color: #333333">.</span><span style="color: #6600EE; font-weight: bold">125</span>rem<span style="color: #333333">/</span><span style="color: #6600EE; font-weight: bold">1</span><span style="color: #333333">.</span><span style="color: #6600EE; font-weight: bold">5</span> <span style="color: #008800; font-weight: bold">sans-serif</span>;
}
</pre></div>
<br>
<p>In the following code I replace the triangle with a plus sign for the closed accordion and with a minus sign for the open accordion.</p>
<!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #007700">summary</span> {
<span style="color: #333333">...</span>
<span style="color: #008800; font-weight: bold">list-style</span><span style="color: #333333">:</span> <span style="color: #008800; font-weight: bold">none</span>; <span style="color: #888888">/* Triangle not shown */</span>
}
<span style="color: #888888">/* Style for Webkit-Browser */</span>
<span style="color: #007700">summary</span><span style="color: #333333">:</span><span style="color: #555555; font-weight: bold">:-webkit-details-marker</span> {
<span style="color: #008800; font-weight: bold">display</span><span style="color: #333333">:</span> <span style="color: #008800; font-weight: bold">none</span>; <span style="color: #888888">/* Triangle not shown */</span>
}
<span style="color: #007700">summary</span><span style="color: #333333">:</span><span style="color: #555555; font-weight: bold">:before</span> {
<span style="color: #008800; font-weight: bold">padding-right</span><span style="color: #333333">:</span> <span style="color: #333333">.</span><span style="color: #6600EE; font-weight: bold">25</span>rem;
<span style="color: #008800; font-weight: bold">content</span><span style="color: #333333">:</span> <span style="background-color: #fff0f0">'+ '</span>; <span style="color: #888888">/* Instead of Triangle closed */</span>
}
<span style="color: #007700">details</span><span style="color: #333333">[</span><span style="color: #007700">open</span><span style="color: #333333">]</span> <span style="color: #007700">summary</span><span style="color: #333333">:</span><span style="color: #555555; font-weight: bold">:before</span> {
<span style="color: #008800; font-weight: bold">padding-right</span><span style="color: #333333">:</span> <span style="color: #333333">.</span><span style="color: #6600EE; font-weight: bold">25</span>rem;
<span style="color: #008800; font-weight: bold">content</span><span style="color: #333333">:</span> <span style="background-color: #fff0f0">'- '</span>; <span style="color: #888888">/* Instead of Triangle open */</span>
}
</pre></div>
<br>
</div><!-- end details-content -->
</details>
<details>
<summary>6. Display the First Accordion Element Openly</summary>
<div class="details-content">
<p>If you don't want to present the first (or any other) Accordion element closed, but opened to the viewers, you insert the attribute "open" into the concerned HTML element "details":</p>
<!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #007700"><details</span> <span style="color: #0000CC">open</span><span style="color: #007700">></span>
<span style="color: #007700"><summary></span>Display the first Accordion element openly<span style="color: #007700"></summary></span>
<span style="color: #007700"><p></span>Text<span style="color: #007700"></p></span>
<span style="color: #007700"></details></span>
</pre></div>
<br>
</div><!-- end details-content -->
</details>
<details>
<summary>Tipp</summary>
<div class="details-content">
<p>In order to place different content elements in the content area of the HTML element "summary", it is advisable to pack them into a "div-container" in order to be able to design them more easily. The code looks like this:</p>
<!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #888888">HTML Code</span>
<span style="color: #007700"><details></span>
<span style="color: #007700"><summary></span>Title<span style="color: #007700"></summary></span>
<span style="color: #007700"><div</span> <span style="color: #0000CC">class=</span><span style="background-color: #fff0f0">"details-content"</span><span style="color: #007700">></span>
<span style="color: #007700"><p></span>A paragraph<span style="color: #007700"></p></span>
<span style="color: #007700"><figure></span>
<span style="color: #007700"><img</span> <span style="color: #0000CC">src=</span><span style="background-color: #fff0f0">"path-to-the-image.png"</span> <span style="color: #0000CC">alt=</span><span style="background-color: #fff0f0">"This is a placeholder picture"</span> <span style="color: #0000CC">title=</span><span style="background-color: #fff0f0">"This is a placeholder picture"</span><span style="color: #007700">></span>
<span style="color: #007700"><figcaption></span>This is a placeholder picture<span style="color: #007700"></figcaption></span>
<span style="color: #007700"></figure></span>
<span style="color: #007700"><ul></span>
<span style="color: #007700"><li></span>List item 1<span style="color: #007700"></li></span>
<span style="color: #007700"><li></span>List item 2<span style="color: #007700"></li></span>
<span style="color: #007700"><li></span>List item 3<span style="color: #007700"></li></span>
<span style="color: #007700"></ul></span>
<span style="color: #007700"><p></span>This is a <span style="color: #007700"><a</span> <span style="color: #0000CC">href=</span><span style="background-color: #fff0f0">""</span><span style="color: #007700">></span>Link<span style="color: #007700"></a></span> to nowhere.<span style="color: #007700"></p></span>
<span style="color: #007700"></div></span><span style="color: #888888"><!-- end details-content --></span>
<span style="color: #007700"></details></span>
</pre></div>
<br>
</div><!-- end details-content -->
</details>
<details>
<summary>7. Browser Support</summary>
<div class="details-content">
<p>Unfortunately not all browsers support the HTML element "details" yet. Internet Explorer and Edge do not support "details", nor does Opera mini. All other current and popular browsers support the function of "details".</p>
<p>In browsers that do not support "details", the accordions are displayed open, so that you can use this feature even if it is not supported continuously. The content will be readable in any case.</p>
<p>On the website <a class="extern" href="https://caniuse.com/#feat=details" target="_blank">caniuse.com</a> you can see which browsers support the HTML function of "details" or not. Here is a corresponding screenshot:</p>
<picture class="card center">
<source srcset="https://www.imarketinx.de/artikel/pics/html-details/html-element-details-caniuse-2018-11-19.max.png" media="(min-width: 600px)">
<source srcset="https://www.imarketinx.de/artikel/pics/html-details/html-element-details-caniuse-2018-11-19.min.png" media="(min-width: 300px)">
<img src="https://www.imarketinx.de/artikel/pics/html-details/html-element-details-caniuse-2018-11-19.png" alt="caniuse.com: Browser-Support für die HTML-Elemente 'details' und 'summary'" title="Browser-Support für HTML-Elemente 'details' und 'summary'">
<p><small><i>Browser-Support für die HTML-Elemente Details and Summary - 19.11.2018</i></small></p>
</picture>
<br>
</div><!-- end details-content -->
</details>
</div><!-- end details-wrapper -->
</body>
*, ::after, ::before {
box-sizing: border-box;
}
html {
font-size: 100%;
}
body {
max-width: 1440px;
}
img {
max-width: 100%;
}
.details-wrapper {
width: 75vw;
margin: 0 auto;
background-color: #BFBFBF;
box-shadow:0 -1px 1px 5px #BFBFBF;
}
details {
padding: .5rem;
font: 1rem/1.2 sans-serif;
}
summary {
padding: .25rem 1rem;
background-color: steelblue;
font: bold 1.25rem/2 sans-serif;
color:floralwhite;
border: none;
border-radius: 3px;
box-shadow: 0 -1px 1px 1px rgba(0,0,0,0.5);
cursor: pointer;
/*list-style: none;*/ /* Triangle not shown */
}
/* Triangle not shown - Style for Webkit-Browser */
/*summary::-webkit-details-marker {
display: none;
}*/
summary::before {
padding-right: .25rem;
/*content: '+ ';*/ /* Instead of Triangle closed */
}
details[open] summary::before {
padding-right: .25rem;
font-style: italic;
/*content: '- ';*/ /* Instead of Triangle open */
}
/* Styling the summary in case of open 'details' */
details[open] summary {
font-style: italic;
border-radius: 3px 3px 0 0;
}
.details-content {
margin: 0;
padding: .25rem 1rem;
background-color: floralwhite;
border-radius: 0 0 3px 3px;
box-shadow: 0 1px 1px 1px rgba(0,0,0,0.5);
color: steelblue;
}
.details-content p {
font: 1.1rem/1.5 sans-serif;
}
Also see: Tab Triggers