Home > Web Front-end > HTML Tutorial > What is the difference between b tag and strong tag in html? Summary of the difference between b and strong

What is the difference between b tag and strong tag in html? Summary of the difference between b and strong

寻∝梦
Release: 2018-09-01 14:47:02
Original
17318 people have browsed it

This article mainly talks about the difference between the b tag and the strong tag in HTML. It also introduces some details about the bolding of b tags and strong tags. Finally, there is a summary of html b tags and strong tags. Finally, let’s take a look at this article.

First of all, this article This article introduces themselves to the b tag and strong tag in HTML:

b tag in HTML:Bold tag elements Tells the browser to display the b-tagged text in bold to the viewer. For all browsers, this means that this text should be presented in a bold (bold) style for everyone to display

strong tag in HTML: < ;/strong>The bold tag element tells the browser to display the strong tag text to the viewer in bold. For all browsers, this means making this text bold for everyone to see. Html strong bold tag and html b bold tag have the same display effect. Both display and present the content text in bold. Both can choose to use

. Let’s look at the code examples one by one. There are renderings:

PHP中文网!<br/>
PHP中文网的网址是<b>www.php.cn</b> !<br/>
我被HTML b标签<b>加粗的</b>。
Copy after login

The effect of this is as follows:

What is the difference between b tag and strong tag in html? Summary of the difference between b and strong##

PHP中文网!<br/>
PHP中文网的网址是<strong>www.php.cn</strong> !<br/>
我被HTML strong标签<strong>加粗的</strong>。
Copy after login
The example renderings of the strong tag are as follows:

What is the difference between b tag and strong tag in html? Summary of the difference between b and strong

After reading so much, I probably still don’t understand much.

Now let’s take a look at some details of b tags and strong tags:

strong represents the meaning of the content text. b means that the text style is bold. The difference between the two is basically invisible in the HTML specification. In xhtml, due to the emphasis on "separation of style and content", the b representing style has been eliminated. Instead, other tags appear. Note that strong does not replace b. strong represents emphasis, and you can customize any style to represent emphasis. It's just that the default style of strong is the same as b.

is an emphasis tag; is a bold tag

They all function as bold fonts. In most cases, they have roughly the same effect. The difference is that the tag is an entity tag, and the characters it surrounds will be set to bold (bold), while A label is a logical label. Its function is to strengthen the mood of a character. Generally speaking, strengthening the mood of a character is achieved by changing the character to bold. But the situation may also be different under different HTML interpreters.

There are two situations in actual web design

1. Consider from the client

In order to make the page effect affected To minimize the impact of client factors, we should try to use entity tags b

often if we are in a certain article. Use strong for keywords that need to be bolded, and words that need to be bolded to attract the user's attention. Still need to use B. The font-weight:bold attribute of CSS is only used when bold fonts are more beautiful in certain places. But from the perspective of SEO, there is basically no difference between b and CSS Font-weight:bold.

It’s not that the introduction of strong eliminates b. b is because it means bolding the font, which happens to be the same as the effect of strong by default. In fact, this strong can be defined in other styles. the emphasis effect.​

2. Considering the w3c standards

In order to comply with the current W3C standards, it is recommended to use the strong tag

strong tag: the visual effect is bold. HTML semantics are emphasis, indicating emphasis and emphasis in tone.

When a blind person uses a screen reader, the difference between B and Strong can be clearly seen. When encountering B, read it in the same way as ordinary words. When encountering Strong, it will be emphasized and paused.

b tag: visual effect bold. It does not have HTML semantics per se.

Summary of the difference between b tag and strong tag in html:

html There is no difference in essence between b bold and html strong bold, and there is no difference in usage and syntax. It is recommended that everyone Don't pursue this problem deliberately; just use the two bold tags according to your usual habits; the html b bold tag is the earlier html that uses the bold function tag, and html strong is later supported by all browsers. Both bold functions.

The above is the entire content of this article. If you have any questions, you can ask below

[Editor’s recommendation]

How to set the font size of the html font tag ? Introduction to the usage of html font tag attribute

What is the document object in html? An article to let you understand the document object

The above is the detailed content of What is the difference between b tag and strong tag in html? Summary of the difference between b and strong. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template