What are the differences between B/strong and I/em in HTML5? -

Source: Internet
Author: User
Tags table definition
0 reply content: In HTML4.01:
<B> <I> is a visual element (presentationl elements), indicating meaningless bold and meaningless italics. The style is {font-weight: bolder }, only "this label should be in bold" or "Here it should be in italic". These two labels are not recommended in HTML4.01;

<Em> and <strong> are elements of expression (phrase elements ). <Em> (emphasized text) indicates general emphasis texts, while <strong> (strong emphasized text) indicates more emphasis texts than <em>.

In the new HTML5 work draft:

<Em> and <strong> are still elements of phrase elements ). However, <strong> indicates the emphasis (emphasized text) on the html page, and <em> indicates the emphasis (meaning) in the sentence)

The B and I labels are defined as follows:
The B element now 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 emboldened.

// Element B is a piece of text that is described in a general article only in terms of style and does not contain any additional importance. For example, keywords in the document summary and product names in the comments. Or the highlighted layout.

The I element now represents a span of text in an alternate voice or mood, or otherwise offset from the normal prose, such as a taxonomic designation, a technical term, an idiomatic phrase from another language, a thought, a ship name, or some other prose whose typical typographic presentation is italicized. usage varies widely by language.

// The I element is now described as highlighting different comments or tone or other text in a common article, for example, a classification name, a technical term, a slang in a foreign language, an idea. Or the Italic layout.

It can be noted from the specification that elements B and I will be given true semantics. More predictable attention should be paid to the different use of B, I, strong, and em.

Reference: http://www.planabc.net/2008/03/14/html5_ B _and_ I _tags_read_semantic/ It should be said that in the default HTML style table definition, B and strong style are the same as {font-weight: bolder}, while em's default style is {font-style: italic}, the same as I.

In HTML 4, em indicates emphasized text, and strong indicates strong emphasized text. Therefore, strong is more powerful. In HTML 5, the definition of strong is changed to important text. Of course, the definition between emphasized and strong emphasized and even important is vague. The key is to maintain consistency when writing HTML code by yourself.

B And I only indicate "here we should show in bold" or "here we should show in italic 」.

Refer:
  1. Default style sheet for HTML 4: http://www.w3.org/TR/CSS2/sample.html
In the default html style And,And. However, in terms of semanticsAndIs the expression element, only change the appearance,AndThis means that the emphasis on behaviors is more important than that on search engines, and some voice readers will also increase their tone when reading.

In addition, all presentation elements are not recommended. css should be used to replace them without being defined by CSS, B and strong have the same display effect in the same browser-the text in this element has become rough. In terms of semantic expression, strong indicates stronger intensity than em. In addition, Element B is the visual element (presentationl elements), and em and strong are the expression elements (phrase elements ). I heard that .....

Em-emphasis emphasizes

Like strong,

In search engines, the weight is higher.

B is just a simple bold or black?

Color is not emphasized.

So em or strong is used for important content or keywords.

The unimportant representation is from the perspective of B's code semantics:

Strong: Increase the tone. The heaviest one.

Em: it is also a strong tone, but the momentum is weaker.

B: It is simply bold and unemotional. Now I represents the icon. It is easy to make a mistake when writing semantic html.
Differences between I, em, B, and strong in HTML
What's the differenceAnd,And?Bold, bold
Is to express the emphasis and the font is bold

It is italic. The font is italic.
It also emphasizes content and is skewed

The two groups of labels have the same implementation method, but they have different meanings. Default effect: both I and em are italics. Both B and strong are bold. There is not much difference.
However, em and strong have stronger semantics and are more friendly to search engine crawlers, so that they can know the semantic effect of the content, B And I only emphasize the visual effect, but the semantics is not helpful.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.