HTML Heading & Paragraph & Formatting

Headings

Headings are defined with the <h1> (the most important heading) to <h6> (the least important) heading tags.

注意:Use HTML headingsfor headings only. Don't use headings to make text BIG or bold

不要使用heading来实现文本字体的加粗或加大效果。

Search engines use your headings to index the structure and content of your web pages. 

搜索引擎使用heading来索引网页的结构和内容。


Paragraphs

Lines

The <hr> tag creates a horizontal line in an HTML page. 在网页中创建水平横线,用于分隔内容。


HTML Display

You cannot change the output by adding extra spaces or extra lines in your HTML code. Make no sense.

在HTML代码中写额外的空格或者是分段都不能改变文档的输出结果

The browser will remove extra spaces and extra lines when the page is displayed. Any number of new lines, and any number of spaces count as one space.

浏览器会删除多余的空格和分段,不论你在同一个元素里代码写了多少个空格(或新段落),都被记为一个空格。
需要在同一个 <p> 里分段记得用标签 <br>

HTML <pre> Element

该元素 定义了 a block of pre-formatted text, with structured spaces and lines.

因此,写在这个元素中的文本可以保留代码里的空格和分段格式。


Formatting Tags

HTML也定义了一些特殊的元素,用来给文本赋予特殊的 meaning。

Often <strong> renders as <b>, and <em> renders as <i>. However, there is a difference in the meaning of these tags: 

<b> or <i> defines bold or italic text only.

<strong> or <em> means that you want the text to be rendered in a way that the user understands as "important".

后两者表示希望指定的文本被用户理解为是重要的,而不仅仅是粗/斜体字,尽管目前浏览器让这些元素以粗体或斜体字显示。

If a browser one day wants to make a text highlighted with the strong feature, it might be cursive 草书体 for example and not bold!


HTML Text Formatting Tags

  • <b> bold text 粗体字

  • <em> emphasized text 强调文本

  • <i> a part of text in an alternate voice or mood 语气转变,通常斜体显示

  • <small> smaller text

  • <strong> important text

  • <sub> appears half a character below the baseline 低于基准线半个字符高度,用于化学式

  • <sup> superscripted text 高于基准线半个字符,用于脚注:WWW[1]

  • <ins> inserted text 给文本加下划线

  • <del> deleted text 给文本加删除线

  • <mark> new in H5 marked/highlighted text,高亮现实文本,IE8及之前不支持


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值