jsp 所有字体及示例
HTML provides different tags for styling. Bold <b> tag is used to make given text bold which is ticker than a normal one. Bold tag is used for the start and end of the text to specify the text we want to make bold.
HTML提供了不同的样式标签。 粗体<b>标记用于使给定文本变为粗体,比普通文本要细。 粗体标签用于文本的开头和结尾,以指定我们要使其变为粗体的文本。
<b>粗体标签 (<b> Bold Tag)
As stated previously bold tag is used by specifying the start and the end of the text block we want to make bold. Bold tag is only effective in the normal text which means using the bold tag in Header tags like H1, h2 do not have any difference.
如前所述,通过指定我们要设为粗体的文本块的开始和结尾来使用粗体标签。 粗体标签仅在普通文本中有效,这意味着在标题标签(如H1,h2)中使用粗体标签没有任何区别。
<html>
<body>
<h1><b>This header is bold</b></h1>
<h1>This header is not bold</h1>
<b>This text is bold</b>
<br>
This text is not bold
</body>
</html>
用CSS粗体(Make Bold with CSS)
Bold is generally used as a tag inside the HTML body by surrounding the text. But We can make the bold specified text by using CSS. The CSS attribute is named font-weight
like below. In this example, we will define a CSS class named bold
and apply by using span
tag like below.
粗体通常在HTML正文中通过包围文本用作标记。 但是我们可以使用CSS制作粗体指定的文本。 CSS属性命名为font-weight
如下所示。 在此示例中,我们将定义一个名为bold
CSS类,并使用如下所示的span
标签进行应用。
<html>
<body>
<span style="font-weight:bold;">This text is bold</span><br>
This text is not bold
<div style="font-weight:bold;"> This div content is bold</div>
This div content is not bold
</body>
</html>
HTML没有<bold>标记(HTML Do Not Have <bold> Tag)
Some novice web programmers and designers assume that there is a tag named <bold>. This is not true. The bold tag is represented as <b> not with <bold> If we try to use <bold> as a tag it will not work like below.
一些新手Web程序员和设计师假定存在一个名为<bold>的标记。 这不是真的。 粗体标记用<b>表示,而不用<bold>表示。如果我们尝试使用<bold>作为标记,则它将无法像下面那样工作。
<html>
<body>
<b>This text is bold</b> <br>
<bold>This text is not bold</bold>
<br>
This text is not bold
</body>
</html>
文字格式元素 (Text Formatting Elements)
Bold tag is named as text formatting element and there are other text formatting elements that can be used for different purposes. Some of the text formatting elements or tags may provide a similar experience to the bold but they are not the same.
粗体标记被命名为文本格式设置元素,还有其他文本格式设置元素可用于不同目的。 某些文本格式设置元素或标记可能会提供与粗体字相似的体验,但它们并不相同。
- <b> is used for bold text. <b>用于粗体文本。
- <strong> is used for important text. <strong>用于重要文本。
- <i> is used for italic text where the text will be leaned <i>用于倾斜文本的斜体
- <em> is used for emphasized text<em>用于强调文字
- <mark> is used for marking text<mark>用于标记文本
- <small> is used for making text smaller<small>用于缩小文本
- <del> deleted text<del>删除的文字
- <ins> is used for inserted text<ins>用于插入文本
- <sub> is used for subscribed text<sub>用于订阅的文本
- <sup> is used superscript like formulas<sup>用于上标,例如公式
粗体标记替代方案强力标记,强调,标记,Head1(Bold Tag Alternatives Strong Tag, Emphasize, Mark, Head1)
There are some tags that are similar to bold investigate them which are used for what and differences with the <bold> tag.
有一些类似于黑体的标记,它们用于与<bold>标记的区别。
- <b> is used to differentiate stylistically from other text and there is no extra importance, keyword, product name. <b>用于在样式上与其他文本区分开,并且没有额外的重要性,关键字,产品名称。
- <em> is used to stress the emphasis of its contents. This can be a keyword, product name, etc. <em>用于强调其内容的重点。 这可以是关键字,产品名称等。
- <h1> , <h2> , <h3> , … are used to create headers which simply describes text sections or parts . <h1>,<h2>,<h3>,...用于创建仅描述文本部分或部分的标题。
- <mark> is used to reference some keyword, name, header, etc at the end of the document. <mark>用于在文档末尾引用一些关键字,名称,标题等。
- <strong> is used to provide some important to the given text. <strong>用于为给定的文本提供一些重要信息。
<html>
<body>
<b>This text is bold</b> <br>
<em> This text is em </em> <br>
<mark> This text is mark </mark> <br>
<h1> This text is h1 </h1>
<br>
<strong> This text is strong </strong> <br>
</body>
</html>
翻译自: https://www.poftut.com/html-bold-tag-usage-and-examples/
jsp 所有字体及示例