Home  >  Article  >  Web Front-end  >  How to make font bold in html

How to make font bold in html

王林
王林Original
2021-06-23 09:37:3815358browse

htmlThe way to bold the font is to add a pair of tags to the text that needs to be bolded, such as [bold text] . The tag is a phrase tag that defines important text for a sample of a computer program.

How to make font bold in html

The operating environment of this article: windows10 system, html 5, thinkpad t480 computer.

In HTML, we need to bold a piece of text without resorting to the font-weight attribute in CSS. We only need to add a pair of tags to the text. Its function is to bold the text, which is very convenient to use.

A tag is a phrase tag that defines important text for a sample of a computer program.

Similar tags include:

  • ## Rendered as highlighted text.​

  • Define important text.​

  • Define a definition item.​

  • Defines computer code text.​ <p></p>
  • Define sample text.

Code example:

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>php中文网(php.cn)</title> 
</head>
<body>

<em>强调文本</em><br>
<strong>加粗文本</strong><br>
<dfn>定义项目</dfn><br>
<code>一段电脑代码 print("Hello World")</code><br>
<samp>计算机样本</samp><br>
<kbd>键盘输入</kbd><br>
<var>变量</var>

</body>
</html>

Let’s take a look at the running effect:

How to make font bold in html

Related video sharing:

html video tutorial

The above is the detailed content of How to make font bold in html. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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