Is it out of date to use
tag nowadays? If so, what should I use instead?
For new line, I coding like this. This is not supposed to do these days?
<br />
<br />
<br />
<br />
Instead of using the <br> tag, you should use a semantic HTML element and the CSS margin or padding properties if necessary.
HTML 5 only requires <br> however <br/> is still fine. If you were using something like XHTML you would want that to be <br /> anyway..
The br tag inserts a line break (not a paragraph break). This tag has no content, so it is self closing.
The <br> HTML element produces a line break in text (carriage-return). It is useful for writing a poem or an address, where the division of lines is significant.
<br />
is meant to be used as to represent a break in said content, a common example would be an address:
<p>
20 street name<br />
City Name<br />
etc.
</p>
As you can see in the above example, the address is all one group of content, the breaks are only for presentational purposes.
In short: <p>
tags should be used to seperate content into blocks, and the <br />
tag should be used for any breaks needed in that content (for presentational purposes, as in the example above)
The <br />
tag is perfectly valid, it's in the current HTML5 spec too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With