📅  最后修改于: 2020-11-01 06:39:37             🧑  作者: Mango
HTML格式设置是格式化文本以获得更好的外观的过程。 HTML使我们无需使用CSS即可格式化文本。 HTML中有许多格式标记。这些标签用于使文本加粗,斜体或带下划线。文本在HTML和XHTML中的显示方式几乎有14种。
在HTML中,格式标记分为两类:
注意:有些物理和逻辑标签可能会显示相同的外观,但是它们的语义会有所不同。
在这里,我们将学习14个HTML格式标签。以下是HTML格式文本的列表。
Element name | Description |
---|---|
This is a physical tag, which is used to bold the text written between it. | |
This is a logical tag, which tells the browser that the text is important. | |
This is a physical tag which is used to make text italic. | |
This is a logical tag which is used to display content in italic. | |
This tag is used to highlight text. | |
This tag is used to underline text written between it. | |
This tag is used to appear a text in teletype. (not supported in HTML5) | |
This tag is used to draw a strikethrough on a section of text. (Not supported in HTML5) | |
It displays the content slightly above the normal line. | |
It displays the content slightly below the normal line. | |
This tag is used to display the deleted content. | |
This tag displays the content which is added | |
This tag is used to increase the font size by one conventional unit. | |
This tag is used to decrease the font size by one unit from base font size. |
HTML和格式元素
HTML元素是一个物理标记,以粗体显示文本,没有任何逻辑上的重要性。如果您在…………元素内编写任何内容,则会以粗体显示。
请参阅以下示例:
Write Your First Paragraph in bold text.
输出:
HTML标签是一个逻辑标签,它以粗体显示内容,并告知浏览器其逻辑重要性。如果您在???????之间写任何东西。 ,显示重要的文字。
请参阅以下示例:
This is an important content, and this is normal content
输出:
This is an important content, and this is normal content
formatting elements
Explanation of formatting element
This is an important content, and this is normal content
HTML和格式元素
HTML元素是物理元素,它以斜体字体显示了包含的内容,没有任何附加的重要性。如果您在…………元素内写任何东西,则以斜体字母显示。
请参阅以下示例:
Write Your First Paragraph in italic text.
输出:
Write Your First Paragraph in italic text.
HTML标签是一个逻辑元素,它将以斜体显示包含内容,并增加了语义的重要性。
请参阅以下示例:
This is an important content, which displayed in italic font.
输出:
This is an important content, which displayed in italic font.
formatting elements
Explanation of italic formatting element
This is an important content, which displayed in italic font.
如果要标记或突出显示文本,则应将内容写在…… 。
请参阅以下示例:
I want to put a Mark on your face
输出:
如果您在………元素内编写任何内容,则会在带下划线的文本中显示。
请参阅以下示例:
Write Your First Paragraph in underlined text.
输出:
Write Your First Paragraph in underlined text.
…………………..元素中写入的所有内容均带有删除线。这是一条跨越声明的细线。
请参阅以下示例:
Write Your First Paragraph with strikethrough.
输出:
Write Your First Paragraph with strikethrough.
如果希望每个字母都具有相同的宽度,则应将内容写在………….元素内。
注意:我们知道大多数字体都称为可变宽度字体,因为不同的字母具有不同的宽度。 (例如:“ w”比“ i”宽)。等宽字体在每个字母之间提供相似的空间。
请参阅以下示例:
Hello Write Your First Paragraph in monospaced font.
输出:
Hello Write Your First Paragraph in monospaced font.
如果将内容放在…………..元素内,则会显示上标;表示它显示为比其他字符高半个字符。
请参阅以下示例:
Hello Write Your First Paragraph in superscript.
输出:
Hello Write Your First Paragraph in superscript.
如果将内容放在…………..元素内,则显示在下标;中。表示它显示为比其他字符低半个字符的高度。
请参阅以下示例:
Hello Write Your First Paragraph in subscript.
输出:
Hello Write Your First Paragraph in subscript.
放进去的任何东西…..显示为已删除的文本。
请参阅以下示例:
Hello Delete your first paragraph.
输出:
Hello
放进去的任何东西…..显示为插入的文本。
请参阅以下示例:
Delete your first paragraph.Write another paragraph.
输出:
Delete your first paragraph.Write another paragraph.
如果要使字体大小大于文本的其余部分,则将内容放在………之内。它增加一种字体大小,比上一种字体大。
请参阅以下示例:
Hello Write the paragraph in larger font.
输出:
Hello Write the paragraph in larger font.
如果要使字体大小小于文本的其余部分,则将内容放在………标记内。它比前一种减小了一种字体大小。
请参阅以下示例:
Hello Write the paragraph in smaller font.
输出:
Hello Write the paragraph in smaller font.