If it is is it possible to control how many lines the <br> tag brings down?

If it is is it possible to control how many lines the
tag brings down? Normally if you used this one it will show this.

<h1>My first website!</h1>
<br>
<p>about me...</p>

OUTPUT

My first website!

about me…

but is it possible to use that same code and do this?

My first website!

.

about me…

*I pit a period in the last output because it would not show the difference if I do not.

Use margins and / or padding to control space between elements. Don’t use the <br> element - that’s not its purpose.

5 Likes

@TechnoBear line-height would also work I think. or <p>. I sometimes do &nbsp;

Using line-height to control spacing between elements will cause problems if the text wraps onto another line, and &nbsp; has very limited legitimate uses.

Margins and padding are designed to create space between and around elements, so use the right tool for the job.

8 Likes

HTML elements define your content, not the layout or visual appearance, that is the purpose of CSS.
So CSS should be used to add the space between the elements.
For example:-

h1 {
   margin-bottom: 3em;
}

This will give you three lines (at the h1 text size) under any h1 element.

2 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.