summary {
transition: background .75s ease;
width: 960px;
outline: 0;
text-align: center;
font-size: 85%;
display: flex;
align-items: center;
cursor: pointer;
border-bottom: 1px solid black;
}
summary::before {
font-family: "Font Awesome 5 Free";
font-weight: 900;
content: '\02795'; /* Unicode character for "plus" sign (+) */
margin-left: 5px;
display: inline-block;
padding-right: 15px;
font-size: 90%;
color: rgb(0, 0, 255);
}
details[open] summary::before {
content: "\2796"; /* Unicode character for "minus" sign (-) */
display: inline-block;
padding-right: 15px;
font-size: 90%;
}
In the shared code above, you have to remove the float: right
from the summary
CSS and remove justify-content: space-between
, it will work also on using before
instead of after
, as after
is used to insert the element after the text where, as with before
it will include the element before the text in the summary tag.