0

<br /> and <hr />

why in Sololearn example use <br /> with <hr /> <p>It's text <br /> hr width="50%"/> It's also text</p> When I erased <br /> I had same result? I am very new at programming, sorry :)

15th Jul 2017, 9:29 PM
AHMAD ABUSLEEM
AHMAD ABUSLEEM - avatar
2 ответов
+ 1
Browser will add close p tag inside, then goes br tag -delete br(simply break line, it's inline element) tag, then hr tag which is block-level element, and it goes in normal flow on next line under first p, then goes next empty p tag
15th Jul 2017, 9:44 PM
Вап
+ 2
<br> makes a break in words Example: This is a line break. <br> Moves the text to the next line. Output: This is a line break. Moves the text to the next line <hr> creates a horizontal line Example: I like turtles! <hr> Output: I Like Turtles! _____________________
16th Jul 2017, 3:41 AM
Brent Mason
Brent Mason - avatar