Home  >  Article  >  Web Front-end  >  HTML text formatting example

HTML text formatting example

WBOY
WBOYOriginal
2016-08-30 09:21:061473browse

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





This text is bold


This text is strong
This text is big
This text is emphasized
This text is italic
This text is small
This text contains subscript
This text contains superscript

The effect is as follows:

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






这是
预格式文本。
它保留了      空格
和换行。

pre 标签很适合显示计算机代码:

for i = 1 to 10
     print i
next i

The effect is as follows:

3. "Computer Output" label: This example demonstrates the display effects of different "Computer Output" labels.





Computer code

Keyboard input
Teletype text
Sample text
<var>Computer variablevar>

注释:这些标签常用于显示计算机/编程代码。

The effect is as follows:

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





Written by "mailto:webmaster@example.com">Donald Duck.
Visit us at:
Example.com
Box 564, Disneyland
USA

The effect is as follows:

5. Abbreviations and acronyms: This example demonstrates how to implement abbreviations or acronyms.





"etcetera">etc.

"World Wide Web">WWW

在某些浏览器中,当您把鼠标移至缩略词语上时,title 可用于展示表达的完整版本。

仅对于 IE 5 中的 acronym 元素有效。

对于 Netscape 6.2 中的 abbr 和 acronym 元素都有效。

The effect is as follows:

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





如果您的浏览器支持 bi-directional override (bdo),下一行会从右向左输出 (rtl);

"rtl"> Here is some Hebrew text

The effect is as follows:

7. Block quotation: This example demonstrates how to implement quotations of different lengths.





这是长的引用:
这是长的引用。这是长的引用。这是长的引用。这是长的引用。这是长的引用。这是长的引用。这是长的引用。这是长的引用。这是长的引用。这是长的引用。这是长的引用。
这是短的引用: 这是短的引用。

使用 blockquote 元素的话,浏览器会插入换行和外边距,而 q 元素不会有任何特殊的呈现。

The effect is as follows:

Eight, delete sub-effects and insert sub-effects.





一打有 二十 十二 件。

大多数浏览器会改写为删除文本和下划线文本。

一些老式的浏览器会把删除文本和下划线文本显示为普通文本。

The effect is as follows:

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