HTML tag semantics--using the B tag or the strong tag

Source: Internet
Author: User

HTML tag semantics, the relevant content online there are many. You can go to study and see if the label you are using has the meaning that it really wants to express, do you use the right label? Today's introduction is the use of B-tags, or strong tags , translated from http://www.think-ink.net/html/bold.htm.

There is a difference between using what's referred to as logical tags and tags that primarily affect visual layout.

If you use the <b> tag to make your text look bold , it does look bold, for example:bold.

If you use a <strong> tag, it will make the text inside its label look thicker in most browsers.

These two different labels are the "emphasis" of the role. The above two sentences are indicated by their respective labels (the corresponding labels are highlighted, as you can notice):

If You use a <B> <b> </b> tag to make the Text  <b> Bold </B> it does look  <b> bold </B> .

If you use a <strong><strong></strong> tag to make the text <strong> Bold</strong> It also looks<strong>bold</strong> in most Browsers.

Similarly, you use the <i> tag to make the text italic, and it does look italic. If you use the <em> tag to make the text look italic, it will appear to be italic in most browsers (but the label actually represents "emphasis").

So why should we use <strong> tags instead of <b> to show emphasis? And it looks like <strong> is a lot longer than the <b> tag. And why use <em> tags to replace <i> tags, they look exactly the same AH.

<strong> and <em> tags are "semantic" tags, and search engines understand these semantics. It is deliberately set to mean "accent" in HTML. Some screen readers may use different inflection when they find these "stressed" labels (a bit strange to translate into turning points). <b> and <i> tags are mainly embodied in the visual effect of the page layout.

<em> is used as a,<strong> to emphasize the emphasis. Most browsers display the highlighted content in italics, which shows the highlighted content in bold, however, this is not necessary, and if it is to determine how the emphasis content is displayed, the best way is to use CSS to define their performance. When you want only visual effects, don't use emphasis. And if you want to emphasize but also feel that bold or italic is not as good as the visual effect, especially italic for Chinese, then you can definitely define some other more striking style to achieve the emphasis of the effect.

You can also use the <cite> tag when you want to represent a reference source. But do not use it to denote "italic", because not all browsers will display the text in the tag in italics. The real intent is for the browser to understand the introduction. Raggett on HTML 4, page.

You should use <strong> and <em> tags when the content of your Web page and certain words need to be emphasized. But be aware of it, just as you cannot always use an exclamation point (!!!) )。 You can use <b> and <i> tags if you are simply showing the user the semantics you want to express when displaying the page.

The first translation of the article, the original artistic conception are lost. We can go to see the original text, my English proficiency is limited, most of the situation with Google, forgive me.

However, this does not create a view of the original author, that is, using the <em> tag instead of the <i> tag to represent italics, because the <em> tag is really emphasized, although it appears to be italic in most browsers, You can use the <i> tag if you simply want to show the italic effect without stressing it. If you have an accent, use the <em> tag.

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.