First look at the effect
<! DOCTYPE html>
The official of the web is such an explanation of HTML <em> tagsThe <em> tag tells the browser to show the text as an emphasis. 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.
HTML <strong> Tags<strong> tags, like <em> tags, are used to emphasize text, but it emphasizes a bit more.
Browsers usually display the contents of the <strong> tag in a different way from the <em> tag, usually using bold fonts (relative to italic) to display the contents, so that the user can distinguish between the two tags.
If common sense tells us that we should use less <em> tags, then the number of <strong> tags should appear less. If the text that is decorated with the <em> tag seems to be shouting loudly, then the text that is decorated with the <strong> tag is like screaming. The words of a taciturn person are always promise, and as such, restricting the use of <strong> can make it more noticeable and effective.
As an example, users who visit W3school frequently notice that the first sentence of many tutorial pages is shown in bold, and in fact, we use <strong> tags for this digest. The reason for using this tag is that we think that the tutorial summary not only summarizes the content of the page, but also is in the most important position of the page, and its content is naturally very important and worth emphasizing.
HTML <b> Tags
<i> tag to tell the browser to display the text contained therein in bold (bold).
Hints and NotesNote: The <b> tag should be used as the last option, according to the HTML5 specification, when no other suitable label is appropriate. HTML5 Specification declaration: You should use
HTML <i> Tags
Tells the browser to display the text contained therein in italics (italic) or italic (oblique) font.
Summary:
Strong and EM are structured labels, while B and I are expressive labels. So how do we use strong and B in website construction, and use EM and I?
It is recommended that you completely discard the B and I tags, while using strong and EM. It's all about expressing meaning and structure, not just appearances.
If we do not need to emphasize a word in the Web page, but want to use bold or italic, we can use CSS, the following two are font bold and italic CSS rules:
{font-weight:bold;} {font-style:italic;}
<b>...</b>
-
in HTML 4, set font to
boldface where possible. Equivalent CSS:
{font-weight: bold}
.
<strong>...</strong>
usually have the same effect in visual browsers, as well as have more semantic meaning, under HTML 4.01.
in
-
HTML 5, however, have its
b
own meaning, distinct from that
strong
. It denotes "text to which attention be being drawn for utilitarian purposes without conveying any extra importance and wit H no implication of an alternate voice or mood. " []
<i>...</i>
-
in HTML 4, set font to
italic where possible. Equivalent CSS:
{font-style: italic}
.
<em>...</em>
usually have the same effect in visual browsers, as well as have more semantic meaning, under HTML 4.01.
in
-
HTML 5, however, have its
i
own semantic meaning, distinct from that
em
. It denotes "a different quality of text" or "an alternative voice or mood"-e.g., a thought, a-ship name, a binary species Name, a foreign-language phrase, etc.[29]
<em>...</em>
-
Emphasis (conventionally displayed in italics)
-
EM
existed in
HTML Internet Dr Aft 1.2, and is
standardized in HTML 2.0; Still current.
<strong>...</strong>
-
Strong emphasis (conventionally displayed bold).
an
-
aural user agent could use different voices for emphasis.
-
STRONG
existed in
HTML Internet Draft 1.2, and is
standardized in HTML 2.0; still current .
The difference between strong and B,em and I tags in html