Hello, I know this question may seem trivial, but I’m wondering which method is better for separating a list of forum topics with a solid 1px border. I can add this line to the article element as a pseudo-class like this:
Thank you. I have a Read More button in the footer. If I need to add some margin above the separator line, I need to increase the margin-bottom of the footer in this case.
<article>
content
<footer>
<p><a href="">Read more button</a></p>
</footer>
</article>
The solutions you provided are very good, and I appreciate them a lot. I’ve received a lot of help on this forum, and you guys are truly amazing. I’ll take a look at the CodePen tomorrow since it’s late night here.
Adding empty elements just for decoration should be avoided in 99.9% of cases unless there is absolutely no other way to do what you want.
An hr used to mean a horizontal rule but its semantics were redefined in html5 to indicate a thematic change between topics in the same section. It is no longer simply a line. Therefore an hr between articles would not be semantic as the article already defines that the section is a thematic change anyway.
As the other posters have demonstrated there is no need for extra elements just for presentational borders.