Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML HTML Basics Images, Text and Links Creating Breaks in Content

Jacky Chau
seal-mask
.a{fill-rule:evenodd;}techdegree
Jacky Chau
Full Stack JavaScript Techdegree Student 8,106 Points

Relation between <hr> element and <section>element

"The HTML <hr> element represents a thematic break between paragraph-level elements: for example, a change of scene in a story, or a shift of topic within a section." <- After reading the above definition, I had some questions.

Question 1:Does the word "section" above necessarily mean the <section> tag?

Question2: Can I use <hr> for the purpose of indicating the transition of one <section> tag to another <section> tag.
For example:

<section>
  <h2>About myself</h2> 
    <p>I am Jacky</p>
</section> 
<hr>
 <section>
 <h2>About herself </h2>
   <p>She is Alice.</p>
</section> 

Thank you very much for your help.

2 Answers

Steven Parker
Steven Parker
229,582 Points

I don't think the word "section" in that particular text is intended to refer to the <section> element. I think they just mean a collection of related text.

And you certainly could place one between actual section elements if you want, though the MDN Page recommends it for separating "paragraph-level elements".

And remember that browsers render it by default as a visible horizontal line.


(something like that :point_up:).