The difference between <strong> and <b>,<em> and <i> tags in html

Source: Internet
Author: User

statement: Reprint Please specify Source:http://www.yin.cc/blog/html_b_strong/

1) about the difference between the B and strong two in the HTML tags, I also used today to pay attention to, used to be mixed with, today at work only notice the difference between the two labels.
On the Web page, they all start with the bold font, the difference is that the,<b> tag is an entity tag, the characters that surround it will be set to bold (bold), and the <strong> tag is a logical label, it is to strengthen the tone of the character, In general, the tone of the reinforcing character is achieved by turning the character into bold (bold).

Note: What is a physical tag? What is a logical tag?

Physical elements emphasize a kind of physical behavior, for example, I put a piece of text with a B mark bold, I mean to tell the browser should be bold to show this text, from the semantics of the word can also be analyzed, B is bold (bold) shorthand, so the B mark conveys the meaning is only bold, There is no other role.

And strong we can literally understand that he is the meaning of the emphasis, so we use this tag to convey a message to the browser to emphasize a certain text, and this strong is what we call the logical element, he is emphasizing the document logic, is not to inform the browser how to display.

Similarly, I is Italic (italic), while EM is emphasize (emphasis).

So, the physical element is telling the browser what format I should display the text in, and the logical elements tell the browser how important these words are.

Summary: Simply said Strong is the label of XHTML in Web standards , strong means "emphasis";b is HTML , and B means bold (bold). Web standards claim that XHTML does not involve specific manifestations, "emphasis" can be emphasized with bold, but also can be emphasized in other ways, such as underline, such as font enlargement, such as red, and so on, can be changed by CSS strong specific performance.

Not to say that there is a strong, the elimination of B, but this b is very innocent, because they represent the font is bold, coincides with the strong by default, the effect of the emphasis on the same, in fact, this strong can be defined as a different style of the emphasis effect

Web standards promote the separation of styles and content, so it is not recommended to use B purely to achieve bold.

From the point of view of the meaning and user experience of XHTML documents, strong is more useful and recommended. And the SEO aspect, is for the optimization situation to be determined.

Conclusion: <strong> and <em> are much more important to search engines than <b> and <i>. It is recommended to use the strong label in order to meet the current standards.

2) The <em> tag tells the browser to show the text as a highlighted content. For all browsers, this means to display the text in italics.

Adding emphasis to the text also requires skill. If you emphasize too much, some important phrases will be omitted, and if you emphasize too little, you will not be able to really highlight the important parts. This is the same as seasoning, it is best not to abuse the emphasis.

Although the contents of the <em> tag are now displayed in italics, they also have a broader meaning, and in the future, browsers may use other special effects to display the highlighted text. If you only want to use italics to display text, use the <i> tab. In addition, the document can include cascading style definitions for changing the display of text.

In addition to highlighting, consider using <em> tags when introducing new terminology or as a fixed style when referencing a particular type of term or concept. For example, W3school often uses <em> tags for important terms. <em> tags can be used to distinguish these names from other italic characters.

The conclusion is as follows, in order to conform to the current standard, it is recommended to use <em> label.

3) Note that the :<strong> label, like the <em> tag , is used to emphasize text, but it emphasizes a bit more.

The difference between <strong> and <b>,<em> and <i> tags in html

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.