body { font-family: "IBM Plex Sans", sans-serif; background-color: rgba(0,0,0,.1); } h2 { margin: 20px auto 80px; font-size: 38px; font-weight: 300; text-align: center; letter-spacing: 2px; line-height: 1.5; } details { width: 75%; min-height: 5px; max-width: 700px; padding: 45px 70px 45px 45px; margin: 0 auto; position: relative; font-size: 22px; border: 1px solid rgba(0,0,0,.1); border-radius: 15px; box-sizing: border-box; transition: all .3s; } details + details { margin-top: 20px; } details[open] { min-height: 50px; background-color: #f6f7f8; box-shadow: 2px 2px 20px rgba(0,0,0,.2); } details p { color: #96999d; font-weight: 300; } summary { font-weight: 500; cursor: pointer; } /* removed outline as for codepen only don't remove focus on elements it's bad accessibility don't be _that_ guy */ summary:focus { outline: none; } summary::-webkit-details-marker { display: none } summary::after { padding: 20px; position: absolute; top: 50%; right: 0; color: rebeccapurple; font-family: "Font Awesome 5 Free"; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 900; text-rendering: auto; -webkit-font-smoothing: antialiased; content: "\f078"; transform: translateY(-50%); transition: .3s ease; } details[open] summary::after { content: "\f057"; font-size: 30px; top: 0; transform: translateY(0); transition: .3s ease; } details[open] summary:hover::after { animation: pulse 1s ease; } @keyframes pulse { 25% { transform: scale(1.1); } 50% { transform: scale(1); } 75% { transform: scale(1.1); } 100% { transform: scale(1); } }