鱼C论坛

 找回密码
 立即注册
查看: 3120|回复: 0

[学习笔记] HTML 基础:标题~水平线~注释 笔记

[复制链接]
发表于 2017-6-16 09:26:19 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
标题
HTML 包含六个级别的标题,按重要性排列:
<h1><h2><h3><h4><h5><h6>
以下代码定义了所有标题:
  1. <h1>This is heading</h1>
  2. <h2>This is heading</h2>
  3. <h3>This is heading</h3>
  4. <h4>This is heading</h4>
  5. <h5>This is heading</h5>
  6. <h6>This is heading</h6>
复制代码
结果:
屏幕快照 2017-06-16 上午8.52.46.png

*不建议使用标题来使文本变大或变粗,因为搜索引擎使用标题来索引网页结构和内容.




水平线
要创建水平线,使用<hr />标签:
  1. <h1>This is heading</h1>
  2. <h2>This is heading</h2>
  3. <h3>This is heading</h3>
  4. <h4>This is heading</h4>
  5. <h5>This is heading</h5>
  6. <h6>This is heading</h6>
  7. <p>This is a paragraph</p>
  8. <hr />
  9. <p>This is a paragraph</p>
复制代码
结果:

屏幕快照 2017-06-16 上午9.00.14.png.png



注释
浏览器不显示注释,但它们有助于记录HTML并添加说明,提醒和其他注释
  1. <!-- This is a comment -->
复制代码
示例:
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.         <title>first page</title>
  5. </head>
  6. <body>
  7. <p>This is a paragraph</p>
  8. <hr />
  9. <p>This is a paragraph</p>
  10. <!-- This is a comment -->
  11. </body>
  12. </html>
复制代码
结果:
屏幕快照 2017-06-16 上午9.10.01.png
*你可以看到注释不会在浏览器中显示.


评分

参与人数 2荣誉 +2 鱼币 +6 收起 理由
小甲鱼 + 4 支持楼主!
不二如是 + 2 + 2 请继续绽放~

查看全部评分

本帖被以下淘专辑推荐:

想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-4-19 10:22

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表