I found that m totally doing wrong when using <br>
for new line
Not necessarily. That is, after all, its express (and only) purpose: Starting a new line. For instance, in poetry a line break is frequently meaningful and yet doesn't start a new paragraph, so:
What's in a name? that which we call a rose
<br>By any other name would smell as sweet;
...is a perfectly reasonable way to write those two lines of Romeo and Juliet.
But if you want to start a new paragraph, you wouldn't use <br>
, you'd end the current paragraph and start a new one:
<p>This is one paragraph</p>
<p>This is another</p>
Similarly, you wouldn't typically use it to break things up in a container like a div
; instead, you'd end one div
and start another:
<div>This is one div</div>
<div>This is another</div>
You can also use CSS to style elements that are normally inline or inline-block to be block like div
elements are, but that's not usually a good idea (there are always exceptions).
If you want to add space between elements, that's what the padding
and margin
CSS properties are for.
` to increase the gap between lines of text; use the CSS margin property or the `
` element.](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/br)
– j08691 Sep 06 '15 at 17:20