Add an Underline to a details Element when It's Open in CSS
December 2025
I like having a little line show up to underline the summary of a details element when it's open. This is how I'm doing it.
HTML
This is the summary
This is some content
And, some more content
Output
This is the summary
This is some content
And, some more content
CSS
}
I want to play around with this more at some point to shift the border so that it's only under the text. This works fine in the mean time.
-a
end of line