You are here

strong, em, and br /

3 posts / 0 new
Last post
NathanJ79
NathanJ79's picture
Offline
Last seen: 4 years 1 month ago
Joined: 2007-07-31 15:07
strong, em, and br /

Just out of curiosity, when did strong replace b for bold, em for i for italics, and br / for br for line breaks? Seems kind of silly. I mean, whatever, but what, again, was wrong with the old codes? Just curious about that.

someoneabc
Offline
Last seen: 14 years 7 months ago
Joined: 2007-04-05 12:34
More info

They didn't replace them, but are usually more appropriate. More info here:
http://green-beast.com/blog/?p=222
For a forum, then, em and strong are more suited.

(EDIT: Moderator question: How do you do inline code? - Pre is blocked text, and code is set to display:none;)

José Pedro Arvela
Offline
Last seen: 5 years 2 months ago
Joined: 2007-07-10 07:29
In HTML 4, the previous b and

In HTML 4, the previous b and i elements became deprecated, that is, valid, but discouraged. And this happened because HTML is a semantic language. And b and i provide no meaning at all, and can be reached trough CSS, as someoneabc showed in the link.

In the development version of HTML 5, b and i have different meanings. b is a somewhat confuse elements that indicates that the text is stylistically offset in a specific way. i indicates a specific text that needs to be styled differently due to its difference (I am bad at explaining and good at using, see someoneabc's link for a better explanation).

So, those elements disappeared but might come back with HTML 5.

About <br> being replaced with <br />, that has a very simple reason:

Recently, the adoption of XHMTL has increased. XHTML is like HTML but based on the XML engine instead. This adds some differences as there is no permission to have errors in the markup, or else, the browser won't render the page.

And one of the errors is not to close opening tags. But typing <br></br> would be strange (and error prone). So, in XHTML, the br element is a self-closing element, that means that, instead of using > to close the opening tag, it is necessary to use />. (this also happens with other self closing elements like img)

But, to remain compatible with HTML (sort of) a person must add a space before the self closing element (that is permited in XHTML) to avoid parsing bugs in older browsers that don't support XHTML.

I hope I was clear and have helped.

Blue is everything.

Log in or register to post comments