document.querySelectorAll('details').forEach((D,_,A)=>{
D.ontoggle =_=>{ if(D.open) A.forEach(d =>{ if(d!=D) d.open=false })}
})
details {
border : 1px solid lightgrey;
width : 24em;
padding : 0 .6em;
border-radius : .3em;
margin : .3em;
}
details > summary {
font-weight : bold;
margin : 0em -.6em;
list-style : none;
display : block;
padding : .5em;
}
details[open] {
padding-bottom : .6em;
}
details[open] summary {
border-bottom : 1px solid #aaa;
margin-bottom : .6em ;
}
summary::marker {
display : none;
}
summary::-webkit-details-marker {
display : none;
}
summary::after {
display : block;
float : right;
content : '\1405';
cursor : pointer;
transition : 180ms;
transform : rotate(90deg);
}
details[open] > summary:after {
transform : rotate(-90deg);
}
summary:hover {
outline : none;
background-color : whitesmoke;
}
<details>
<summary>Lorem ipsum one</summary>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor,
dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas
ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie,
enim est eleifend mi, non fermentum diam nisl sit amet erat.
</details>
<details>
<summary>Lorem ipsum two</summary>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor,
dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas
ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie,
enim est eleifend mi, non fermentum diam nisl sit amet erat.
</details>
<details>
<summary>Lorem ipsum three</summary>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor,
dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas
ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie,
enim est eleifend mi, non fermentum diam nisl sit amet erat.
</details>