Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

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.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

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.

+ add another resource

Packages

Add Packages

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.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <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">&lt;details&gt;&lt;p&gt;</span>Collapsible contents<span style="color: #007700">&lt;/p&gt;&lt;/details&gt;</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">&lt;details&gt;</span>
   <span style="color: #007700">&lt;summary&gt;</span>Title or heading<span style="color: #007700">&lt;/summary&gt;</span>
   <span style="color: #007700">&lt;p&gt;</span>Here comes the collapsible text.<span style="color: #007700">&lt;/p&gt;</span>
<span style="color: #007700">&lt;/details&gt;</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">&lt;details&gt;</span>
   <span style="color: #007700">&lt;summary&gt;</span>Title or Heading<span style="color: #007700">&lt;/summary&gt;</span>
   <span style="color: #007700">&lt;p&gt;</span>Here comes the collapsible text.<span style="color: #007700">&lt;/p&gt;</span>
<span style="color: #007700">&lt;/details&gt;</span>

<span style="color: #007700">&lt;details&gt;</span>
   <span style="color: #007700">&lt;summary&gt;</span>Title or Heading<span style="color: #007700">&lt;/summary&gt;</span>
   <span style="color: #007700">&lt;p&gt;</span>Here comes the collapsible text.<span style="color: #007700">&lt;/p&gt;</span>
<span style="color: #007700">&lt;/details&gt;</span>

<span style="color: #007700">&lt;details&gt;</span>
   <span style="color: #007700">&lt;summary&gt;</span>Title or Heading<span style="color: #007700">&lt;/summary&gt;</span>
   <span style="color: #007700">&lt;p&gt;</span>Here comes the collapsible text.<span style="color: #007700">&lt;/p&gt;</span>
<span style="color: #007700">&lt;/details&gt;</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: &#39;+ &#39;;*/</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: &#39;- &#39;;*/</span> <span style="color: #888888">/* Instead of Triangle open */</span>
}

<span style="color: #888888">/* Styling the summary in case of open &#39;details&#39; */</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">&#39;+ &#39;</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">&#39;- &#39;</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">&lt;details</span> <span style="color: #0000CC">open</span><span style="color: #007700">&gt;</span>
  <span style="color: #007700">&lt;summary&gt;</span>Display the first Accordion element openly<span style="color: #007700">&lt;/summary&gt;</span>
  <span style="color: #007700">&lt;p&gt;</span>Text<span style="color: #007700">&lt;/p&gt;</span>
<span style="color: #007700">&lt;/details&gt;</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">&lt;details&gt;</span>
   <span style="color: #007700">&lt;summary&gt;</span>Title<span style="color: #007700">&lt;/summary&gt;</span>
   <span style="color: #007700">&lt;div</span> <span style="color: #0000CC">class=</span><span style="background-color: #fff0f0">&quot;details-content&quot;</span><span style="color: #007700">&gt;</span>
      <span style="color: #007700">&lt;p&gt;</span>A paragraph<span style="color: #007700">&lt;/p&gt;</span>
      <span style="color: #007700">&lt;figure&gt;</span>
         <span style="color: #007700">&lt;img</span> <span style="color: #0000CC">src=</span><span style="background-color: #fff0f0">&quot;path-to-the-image.png&quot;</span> <span style="color: #0000CC">alt=</span><span style="background-color: #fff0f0">&quot;This is a placeholder picture&quot;</span> <span style="color: #0000CC">title=</span><span style="background-color: #fff0f0">&quot;This is a placeholder picture&quot;</span><span style="color: #007700">&gt;</span>
         <span style="color: #007700">&lt;figcaption&gt;</span>This is a placeholder picture<span style="color: #007700">&lt;/figcaption&gt;</span>
      <span style="color: #007700">&lt;/figure&gt;</span>
      <span style="color: #007700">&lt;ul&gt;</span>
         <span style="color: #007700">&lt;li&gt;</span>List item 1<span style="color: #007700">&lt;/li&gt;</span>
         <span style="color: #007700">&lt;li&gt;</span>List item 2<span style="color: #007700">&lt;/li&gt;</span>
         <span style="color: #007700">&lt;li&gt;</span>List item 3<span style="color: #007700">&lt;/li&gt;</span>
      <span style="color: #007700">&lt;/ul&gt;</span>
      <span style="color: #007700">&lt;p&gt;</span>This is a <span style="color: #007700">&lt;a</span> <span style="color: #0000CC">href=</span><span style="background-color: #fff0f0">&quot;&quot;</span><span style="color: #007700">&gt;</span>Link<span style="color: #007700">&lt;/a&gt;</span> to nowhere.<span style="color: #007700">&lt;/p&gt;</span>
   <span style="color: #007700">&lt;/div&gt;</span><span style="color: #888888">&lt;!-- end details-content --&gt;</span>
<span style="color: #007700">&lt;/details&gt;</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>
              
            
!

CSS

              
                *, ::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;
}
              
            
!

JS

              
                
              
            
!
999px

Console