欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

HTML总结 原圳瑀

程序员文章站 2022-06-06 18:37:04
...

HTML的学习记录

HTML结构

基础定义

  1. <!DOCTYPE html> 声明为HTML5文档

  2. <html>元素是HTML页面的根元素

  3. <head>元素包含了文档的元的数据

  4. <title> 元素描述了文档的标题

  5. <body>元素包含了可见的页面内容

  6. <h1>-<h6>元素定义大标题

  7. <p>元素定义一个段落

    特殊作用

    • 插入图片:代码例如<img src=“https://mdbootstrap.com/img/logo/mdb192x192.jpg” alt=“MDB Logo” width=“200” height=“200”\

      <img src=“picture.jpg”>该图片文件与当前文档在同一目录中

      <img src="./images/picture.jpg">该图片文件在当前目录下的images目录中

      <img src="…/picture.jpg">该图片文件在上一级目录中

    • 超链接:超链接由<a>标签定义,链接地址在href属性中指定;

      例如<a href=“http://www.baidu.com”>百度

    • 表格操作:有时候页面内容需要用表格呈现,所以用<table>表格进行操作,代码中<tr>代表行,<td>代表行中单元,<th>是表头的单元。

    • 无序列表使用<ul>标签,默认使用实心圆点作为每项的标志,其它的标志可以是空心圆circle,实心方块square以及不出现标志。

      有序列表使用<ol>标签,默认使用数字作为每项的标志,其它的标志可以是大写字母A,小写字母a,罗马字母i等。

    • 文本格式:html字体文本有多种显示格式,

      <p>You can use the mark tag to <mark>highlight</mark> text.</p>
      <p><del>This line of text is meant to be treated as deleted text.</del></p>
      <p><s>This line of text is meant to be treated as no longer accurate.</s></p>
      <p><ins>This line of text is meant to be treated as an addition to the document.</ins></p>
      <p><u>This line of text will render as underlined</u></p>
      <p><small>This line of text is meant to be treated as fine print.</small></p>
      <p><strong>This line rendered as bold text.</strong></p>
      <p><em>This line rendered as italicized text.</em></p>
      

      这样就会显示:

      You can use the mark tag to highlight text.

      This line of text is meant to be treated as deleted text.

      This line of text is meant to be treated as no longer accurate.

      This line of text is meant to be treated as an addition to the document.

      This line of text will render as underlined

      This line of text is meant to be treated as fine print.

      This line rendered as bold text.

      *This line rendered as italicized text.

相关标签: web development