Will the <B> and <I> Tags Ever Become Deprecated

Will the b and i tags ever become deprecated?

If you end up doing <span class="bold"> a lot you are not correctly using either span, nor class names. Class names should tell you what the tag is, not what it looks like.

The correct replacement for <b> and <i> are <strong> and <em>, and they should be used to note that the specific text inside has a different meaning than the surrounding text.

Update: New specification for <b>, <i>,<strong>,<em> released under HTML 5

In HTML5 <b> and <i> have specific meaning as do <strong> and <em>. Use them all as specified.

4.6.2 The em element :

The em element represents stress emphasis of its contents.

4.6.3 The strong element:

The strong element represents strong importance, seriousness, or urgency for its contents.

4.6.16 The i element:

The i element represents [...] otherwise offset from the normal prose [...], such as a taxonomic designation, a technical term, [...].

4.6.17 The b element:

The b element represents a span of text to which attention is being drawn for utilitarian purposes [...], such as key words in a document abstract, product names in a review [...].

What's the difference between b and strong , i and em ?

They have the same effect on normal web browser rendering engines, but there is a fundamental difference between them.

As the author writes in a discussion list post:

Think of three different situations:

  • web browsers
  • blind people
  • mobile phones

"Bold" is a style - when you say "bold a word", people basically know that
it means to add more, let's say "ink", around the letters until they stand out
more amongst the rest of the letters.

That, unfortunately, means nothing to a blind person. On mobile phones
and other PDAs, text is already bold because screen resolution is very small. You can't bold a bold without screwing something up.

<b> is a style - we know what "bold" is supposed to look like.

<strong> however is an indication of how something should be understood. "Strong" could (and often does) mean "bold" in a browser, but it could also mean a lower tone for a speaking program like Jaws (for blind people) or be represented by an underline (since you can't bold a bold) on a Palm Pilot.

HTML was never meant to be about styles. Do some searches for "Tim Berners-Lee" and "the semantic web." <strong> is semantic—it describes the text it surrounds (e.g., "this text should be stronger than the rest of the text you've displayed") as opposed to describing how the text it surrounds should be displayed (e.g., "this text should be bold").

Will the center tag ever be phased out of HTML?

In the beginning there was HTML and it was good.

Then the need to change how HTML was presented arose and HTML grew to encompass presentational elements such as <center> <b> <i> and everyone rejoiced... "yayyyyy"

Then people began to realise that what they had wrought was ugly: "boooooo" and they rejected these presentational elements and instead spawned a new entity called CSS. CSS could control the presentation while maintaining separation from the structure, promoting reuse, consistency and faster development and all was good and there was much merriment.

Now HTML and CSS live in harmony and presentational elements wallow in the grimy grimness that is deprecation.

Deprecated code: b vs style= font-weight:bold;

The correct question is: "What markup best describes my content?"

Let's start with the <b> tag (which is not deprecated):

The b element represents a span of text to be stylistically offset
from the normal prose without conveying any extra importance, such as
key words in a document abstract, product names in a review, or other
spans of text whose typical typographic presentation is boldened.

...

You should not use b and i tags if there is a more descriptive and
relevant tag available. If you do use them, it is usually better to
add class attributes that describe the intended meaning of the markup,
so that you can distinguish one use from another.

...

It may help to think of b or i elements as essentially a span element
with an automatic fallback styling. Just like a span element, these
elements usually benefit from class names if they are to be useful.

http://www.w3.org/International/questions/qa-b-and-i-tags

By comparison, <strong> has a more specific purpose:

The strong element represents a span of text with strong importance.

http://www.w3.org/TR/html-markup/strong.html

For example:

<p><strong>Warning.</strong> Here be dragons.</p>

Here we emphasize the word "warning" to stress its importance.

But not:

<p><strong>Item 1:</strong> Foo, bar, and baz.</p>

"Item 1" isn't meant to be stressed, so <strong> is the wrong tag. Furthermore, it's possible that the whole structure could be better represented.

If the meaning of the text has strong importance, <strong> is appropriate (just like this line).

Perhaps you just want a thicker font for style purposes and the text has no particular meaning. In that case, neither <strong> nor <b> may be appropriate.

<span class="product-name">Hello World</span>

.product-name { font-weight: bold; }

In all cases:

  • Use the markup which describes the content.
  • Do not use inline styles (use an external stylesheet).
  • Do not name styles based on their visual representation (e.g. naming a style "bold" is a poor choice)

Would <b> be better because if someone has css turned off on the
browser, it would still be show correctly?

No. Use the correct markup for the job. It's fairly unusual for someone using the visual representation of your site to willingly disable the stylesheet, but non-visual consumers care primarily about the structure of your document. A "non-visual consumer" could be a search engine parsing your content or a screen reader application.

Additional Reading:

  • http://www.w3.org/TR/html51/text-level-semantics.html#the-strong-element
  • http://www.w3.org/TR/html51/text-level-semantics.html#the-b-element

what is wrong using b and separation of logic

It's a matter of 'best practices'. Avoiding inline styling, such as the use of the <b> tag is done to improve readability. You can then reuse the class "wuuk_time" throughout your HTML later, as you see fit.

Moreover, if you would like to change the styling to italicized instead of bold for example, it would be easier to change the "wuuk_time" class to reflect your desired changes throughout the webpage as opposed to hunting down all the individual <b> tags in your HTML.

Readability, Maintainability.

i, b, s or em, strong, del

Tags are no longer deprecated, semantic use recommended

You can use all 6 tags semantically. That is: Use them to markup parts of the text according to its meaning. Read more about this in the specs:

4.6.2 The em element:

The em element represents stress emphasis of its contents.

4.6.3 The strong element:

The strong element represents strong importance, seriousness, or urgency for its contents.

4.6.3 The del element:

The del element represents a removal from the document.

4.6.16 The i element:

The i element represents [...] otherwise offset from the normal prose [...], such as a taxonomic designation, a technical term, [...].

4.6.17 The b element:

The b element represents a span of text to which attention is being drawn for utilitarian purposes [...], such as key words in a document abstract, product names in a review [...].

4.6.17 The s element:

The s element represents contents that are no longer accurate or no longer relevant.

The <b>, <i> and <s> tags are no longer deprecated in HTML5. But do not use the above tags only for the purpose of styling text in their particular manner.

Use CSS for styling purposes

Depending on the overall visual appearance of your page, it may be appropriate to style some other parts of the page similar to the default appearance of the text in those tags. This is where you can use the CSS properties.



Related Topics



Leave a reply



Submit