HTML developmen...login
HTML development manual
author:php.cn  update time:2022-04-11 17:45:33

HTML text formatting


Instance

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

<b>加粗文本</b><br><br>
<i>斜体文本</i><br><br>
<code>电脑自动输出</code><br><br>
这是 <sub> 下标</sub> 和 <sup> 上标</sup>

</body>
</html>

Run Instance»

Click the "Run Instance" button View online examples


HTML formatting tags

HTML Use the tags <b> and <i> to format the output text, such as: Bold Italic or Italic

These HTML tags are called formatting tags (see the complete tag reference manual at the bottom, and also check the HTML Programming Dictionary).


Online example

Text formatting
This example demonstrates how to format text in an HTML file

Preformatted text
This example demonstrates how to use the pre tag to control empty lines and spaces.

"Computer Output" Label
This example demonstrates the display effects of different "Computer Output" labels.

Address
This example demonstrates how to write an address in an HTML file.

Abbreviations and acronyms
This example demonstrates how to implement an abbreviation or acronym.

Text direction
This example demonstrates how to change the direction of text.

Block Quote
This example demonstrates how to implement quotations of different lengths.

Delete word effect and insert word effect
This example demonstrates how to mark deleted text and inserted text.


HTML text formatting tag

lamp.jpg#Normal tag <strong> is used instead of bold tag <b>, <em> is used instead of < ;i> tag is used.
However, the meanings of these tags are different:

<b> vs. <i> define bold or italic text.

<strong> or <em> means that the text you want to present is important, so highlight it. All major browsers today can render fonts in a variety of effects. However, future browsers may support better rendering.
Define bold text##<em>##<i>##<small> <strong><sub><sup>Definition of superscript charactersDefine delete word

HTML "Computer Output" Tag

TagDescription
##<b>
Define emphasized text
Definition italics
Definition of small characters
Definition of emphasis
Define subscript
Definition of superscript characters##<ins>
<del>
##TagDescription##<code> ;##<kbd><samp><var>##<pre>HTML Citation, Quote, and Tag Definition
Define computer code
Define keyboard code
Definition of computer code sample
Define variables
Define preformatted text

TagDescriptiondefine abbreviationdefine addressDefine text direction##<blockquote>Define long quotesDefine short quotesDefinition reference, citationDefine a definition project.
##< ;abbr>
<address>
<bdo>
##<q>
<cite>
<dfn>