Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
392 views
in Technique[技术] by (71.8m points)

html - Will the <b> and <i> tags ever become deprecated?

(This is more of a curiousity question than any pending disaster :D )

So the <b> and <i> tags have been around since near the beginning of the web (I assume). But now we have CSS and many people apposing "stylistic html tags." They are stylistic tags, but they're really not so bad, as they save us from having to make a <span class="bold"> a whole bunch of times, reducing download times. Seeing as they don't take up much space, are easy to use, can possibly be useful to screen-readers, search engines, and other applications that don't care much about how a document looks, and removing them would break TONS of html code, I'm guessing probably not, but I still wanted to bring up the topic. :)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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 [...].


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...