Is <br/> acceptable?
Printable View
Is <br/> acceptable?
It's encouraged in XHTML 1.0
Why do you ask?
For backwards compatibility you should but a space after the r:
As for a line break it's perfectly acceptable. You should not use it to seperate paragraphs though, that's where the p tag is for:Code:<br />
Wrong:
Right:Code:long story...
long story...long story...
<br /><br />
long story...long story...
long story...
Code:<p>
long story...
long story...long story...
</p>
<p>
long story...long story...
long story...
</p>
I saw it in some HTML code and I was wondering if it was a malformed tag or a new standard.
Thanks for the input. :)
Since both solutions are perfectly valid, I suppose it's up to the one who writes the markup?Quote:
Originally posted by Jop
For backwards compatibility you should but a space after the r:
As for a line break it's perfectly acceptable. You should not use it to seperate paragraphs though, that's where the p tag is for:Code:<br />
Wrong:
Right:Code:long story...
long story...long story...
<br /><br />
long story...long story...
long story...
Code:<p>
long story...
long story...long story...
</p>
<p>
long story...long story...
long story...
</p>
Well I personally tend to use tags for what they're made for. Using paragraphs makes life so much easier than just putting linebreaks everywhere. Ofcourse it works, but it's harder to maintain, harder to style etc. Ofcourse you can play soccer with a basketball, but that's not what they're made for. Please play soccer with a soccerball. Thank you.
Since XHTML 1.1 allows the creation of your own tags, the definition of one tag is suddenly changed, especially when using the box model... I think doing as you do might be a bit... old?
I don't think the defenition of the p or br tag has changed at all. But since the early days people are used to abusing tags, while making maintaing harder for themselves. It's now time to re-learn writing html in a good way.
And what do you mean by "when using the box model", and more importantly, which of my code is old? Please eleborate.