When we use HTML tags, we must know clearly that in addition to having certain semantics, tags also have default styles, such as <b> (bold), <em> (italic), etc. Through these tags, we can use them without resorting to CSS. Define styles for content on web pages. Many of these tags with semantics and default styles are for text. Through these tags, we can format the text (add styles to the text), such as making the text bold , italic , or underlining .
What are the HTML text formats?
Example:
(1)<b> Bold text </b>
(2) <i> italic text </i>
(3) <code>Computer automatic output</code>
(4) This is <sub>subscript</sub> and <sup>superscript</sup>
The above four are the ones we often use. Here are the many tags used to format text in HTML, so that you can find and record them in the future:
According to different functions, these formatted text tags can be divided into two categories according to the meaning and function of the text:
(1) Physical tags: These tags are used to set the appearance of text;
(2) Logical tags: This type of tag is used to give the text some logical or semantic value.
As can be seen from the above table, some tags have the same presentation effect but different semantics, such as <strong> and <b> tags, <em> and <i> tags, which will be introduced in detail below.
● Difference between <strong> and <b> tags
Similar points: b and strong both make the font bold.
Difference one:
But strong has stronger semantics, which is better for optimizing search and allows it to know the semantic effect of your content. b only emphasizes the visual effect, but is not helpful semantically.
Difference two:
Strong is the tag of xhtml in the web standard, and strong means "emphasis"; b is of html, and b means bold (bold).
In order to comply with current W3C standards, it is recommended to use the strong tag.
●The difference between <em> and <i> tags
The main difference: <em> is a content-based style, and <i> is a physics-based style.
<i> is a visual element (presentationl element), which respectively means meaningless bold and meaningless italics. It only means that the style is bold or italic, but has no emphasized semantics. These two tags are not included in HTML4.01. Recommended to use, it is recommended to use CSS style;
< em > are phrase elements. < em > (emphasized text) represents general emphasized text, and this tag has semantic meaning. The content in this tag is more valued in search engines, and some voice readers will also emphasize the tone when reading based on it.