I, B, and P tags

They have: 222 posts

Joined: Sep 1999

I heard that it's better to use EM instead of I and STRONG instead of B, is there any reason for that?

Also, is there any reason to put /P at the end of a paragraph?

Vincent Puglia's picture

They have: 634 posts

Joined: Dec 1999

Hi IanD,

If I remember right "i" and "b" are being excommunicated, discarded, discontinued, degraded. This means future browsers may not recognize them. Regarding "": this also has become a new standard and eventually will be enforced.

If you want the latest standards, see w3.org If you need a better explanation, wait until Suzanne finds this thread, I usually defer to her on css/html questions

Vinny

Where the world once stood
the blades of grass cut me still

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

The difference betwen i/em and b/strong is structural and more noticable for non-visual browsers. and just define how a piece of text will look on a screen - it doesn't have any kind of meaning associated with it. and do have meaning.

The w3c is moving away from using HTML to describe visual presentation - the new xhtml standard will only use mark-up for structure. CSS will be used to define how things look. Emphasis is structural, italics are visual... get it?

xhtml is much stricter than HTML - all tags must be closed. The way the cascading aspect of CSS works is that one element inherets the properties of its parent element. So, if you don't close your tags then you'll just end up with a whole series of nested paragraphs. This can be a big problem if you're trying to use relative font sizes.

Hopefully Suzanne will be able to explain this better!

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

I think Vinny and Megan explained it great!

The only thing I'll add is that moving to standardized code that keeps presentation from structure will also save you time (by the bushel).

And that xhtml requires consistency and logic that you may not be used to applying to your code, so you should consider using the validation services available from w3c, or through products like htmlvalidator.com or bradsoft.com (topstyle) (both for windows only).

Smiling Suzanne

They have: 222 posts

Joined: Sep 1999

Thanks Smiling

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.