summary, details

설명
디테일 박스로 상세 설명 보여주기 FAQ 등에 쓰면 됨
Primary
content category
interactive
flow

details

notion image
<details> // 짧은 설명 <summary>System Requirements</summary> // 디테일한 설명 <p> Requires a computer running an operating system. The computer must have some memory and ideally some kind of long-term storage. An input device as well as some form of output device is recommended. </p> </details>

열린 채로 시작

  • 디테일 박스가 열린 채로 시작하길 원한다면 <details open>

한번에 하나만 열기

  • 한번에 하나만 열어볼 수 있게 하고 싶을 경우 name을 동일하게 설정
<details name="reqs"> </details> <details name="reqs"> </details> <details name="reqs"> </details>
notion image

여닫이 모양 커스터마이징

notion image
details { font-size: 1rem; font-family: "Open Sans", Calibri, sans-serif; border: solid; padding: 2px 6px; margin-bottom: 1em; } details:first-of-type summary::marker, :is(::-webkit-details-marker) { content: "+ "; font-family: monospace; color: red; font-weight: bold; } details[open]:first-of-type summary::marker { content: "- "; }
notion image
details:last-of-type summary { list-style: none; &::after { content: "+"; color: white; background-color: darkgreen; border-radius: 1em; font-weight: bold; padding: 0 5px; margin-inline-start: 5px; } [open] &::after { content: "-"; } } details:last-of-type summary::-webkit-details-marker { display: none; }