百度前端技术学院 第二天学习笔记(HTML)(2)

学习HTML中的笔记

单元格边距(Cell padding)

本例演示如何使用 Cell padding 来创建单元格内容与其边框之间的空白。

单元格间距(Cell spacing)

本例演示如何使用 Cell spacing 增加单元格之间的距离。


有序列表(ol)与无序列表(ul)

  • ul: unordered lists 无序列表
  • ol: ordered lists 有序列表
  • 两种列表中的每个列表项始于<li>
1
2
3
4
<ul>
<li>Coffee</li>
<li>Milk</li>
</ul>
1
2
3
4
<ol>
<li>Coffee</li>
<li>Milk</li>
</ol>
无序列表中的不同类型

<ul>的属性

  • type=”disc”实心圆(默认)
  • type=”circle”空心圆
  • type=”square”实心方块
有序列表中的不同类型

<ol>的属性

  • 默认:数字列表
  • type=”A”:大写字母列表
  • type=”a”:小写字母列表
  • type=”I”:罗马字母列表
  • type=”i”:小写罗马字母列表

定义列表dl

  • dl:definition list
  • 自定义列表以<dl>标签开始。每个自定义列表项以<dt>开始。每个自定义列表项的定义以 <dd> 开始。
    1
    2
    3
    4
    5
    6
    <dl>
    <dt>Coffee</dt>
    <dd>Black hot drink</dd>
    <dt>Milk</dt>
    <dd>White cold drink</dd>
    </dl>
    实现效果:
    Coffee
    Black hot drink
    Milk
    White cold drink

分类块级元素:<div>元素

  • <div>元素块级元素,它是可用于组合其他 HTML 元素的容器。
  • <div> 元素没有特定的含义。除此之外,由于它属于块级元素,浏览器会在其前后显示折行
  • 设置 <div> 元素的类(style),使我们能够为相同的
    元素设置相同的类
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    <!DOCTYPE html>
    <html>
    <head>
    <style>
    .cities {
    background-color:black;
    color:white;
    margin:20px;
    padding:20px;
    }
    </style>
    </head>

    <body>

    <div class="cities">
    <h2>London</h2>
    <p>
    London is the capital city of England.
    It is the most populous city in the United Kingdom,
    with a metropolitan area of over 13 million inhabitants.
    </p>
    </div>

    </body>
    </html>

分类行内元素:<span> 元素

  • <span>元素是内联元素,可用作文本的容器。
  • 元素也没有特定的含义。
  • 内联元素在显示时通常不会以新行开始。
  • 设置 <span> 元素的类(style),能够为相同的 元素设置相同的样式。
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    <!DOCTYPE html>
    <html>
    <head>
    <style>
    span.red {color:red;}
    </style>
    </head>
    <body>

    <h1>My <span class="red">Important</span> Heading</h1>

    </body>
    </html>

HTML布局


HTML 框架

  • 重要提示: 不能 将 标签与 标签同时使用!不过,假如你添加包含一段文本的 标签,就必须将这段文字嵌套于 <body></body> 标签内。(在下面的第一个<a target="_blank" rel="noopener" href="https://www.w3school.com.cn/tiy/t.asp?f=html_noframes">实例</a>中,可以查看它是如何实现的。)<figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">html</span>&gt;</span></span><br><span class="line"></span><br><span class="line"><span class="tag">&lt;<span class="name">frameset</span> <span class="attr">cols</span>=<span class="string">&quot;25%,50%,25%&quot;</span>&gt;</span></span><br><span class="line"> <span class="tag">&lt;<span class="name">frame</span> <span class="attr">src</span>=<span class="string">&quot;/example/html/frame_a.html&quot;</span>&gt;</span></span><br><span class="line"> <span class="tag">&lt;<span class="name">frame</span> <span class="attr">src</span>=<span class="string">&quot;/example/html/frame_b.html&quot;</span>&gt;</span></span><br><span class="line"> <span class="tag">&lt;<span class="name">frame</span> <span class="attr">src</span>=<span class="string">&quot;/example/html/frame_c.html&quot;</span>&gt;</span></span><br><span class="line"></span><br><span class="line"><span class="tag">&lt;<span class="name">noframes</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">body</span>&gt;</span>您的浏览器无法处理框架!<span class="tag">&lt;/<span class="name">body</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">noframes</span>&gt;</span></span><br><span class="line"></span><br><span class="line"><span class="tag">&lt;/<span class="name">frameset</span>&gt;</span></span><br><span class="line"></span><br><span class="line"><span class="tag">&lt;/<span class="name">html</span>&gt;</span></span><br></pre></td></tr></table></figure></li> <li>通过使用框架,你可以在同一个浏览器窗口中显示不止一个页面。</li> </ul> <h4 id="框架结构标签()"><a href="#框架结构标签()" class="headerlink" title="框架结构标签(&lt;frameset&gt;)"></a>框架结构标签<code>(&lt;frameset&gt;)</code></h4><ul> <li>框架结构标签<code>(&lt;frameset&gt;)</code>定义如何将窗口分割为框架</li> <li><strong>每个</strong> frameset 定义了一系列行<strong>或</strong>列(<a target="_blank" rel="noopener" href="https://www.w3school.com.cn/tiy/t.asp?f=html_frame_mix">混合框架结构</a>使用<strong>两对<frameset></strong> 将含有三份文档的框架结构<strong>混合置于行和列之中</strong>)</li> <li><strong>rows&#x2F;columns(cols)的值</strong>规定了每行或每列占据屏幕的面积(rows&#x3D;”25%,50%,25%”规定了每行占据屏幕的面积【宽度】)</li> <li>frameset 标签也被某些文章和书籍译为框架集。</li> </ul> <h4 id="框架标签(Frame)"><a href="#框架标签(Frame)" class="headerlink" title="框架标签(Frame)"></a>框架标签(Frame)</h4><p>Frame 标签定义了放置在每个框架中的 HTML 文档。</p> <figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">html</span>&gt;</span></span><br><span class="line"></span><br><span class="line"><span class="tag">&lt;<span class="name">frameset</span> <span class="attr">cols</span>=<span class="string">&quot;25%,50%,25%&quot;</span>&gt;</span></span><br><span class="line"></span><br><span class="line"> <span class="tag">&lt;<span class="name">frame</span> <span class="attr">src</span>=<span class="string">&quot;/example/html/frame_a.html&quot;</span>&gt;</span></span><br><span class="line"> <span class="tag">&lt;<span class="name">frame</span> <span class="attr">src</span>=<span class="string">&quot;/example/html/frame_b.html&quot;</span>&gt;</span></span><br><span class="line"> <span class="tag">&lt;<span class="name">frame</span> <span class="attr">src</span>=<span class="string">&quot;/example/html/frame_c.html&quot;</span>&gt;</span></span><br><span class="line"></span><br><span class="line"><span class="tag">&lt;/<span class="name">frameset</span>&gt;</span></span><br><span class="line"></span><br><span class="line"><span class="tag">&lt;/<span class="name">html</span>&gt;</span></span><br></pre></td></tr></table></figure> <p>在上面的这个<a target="_blank" rel="noopener" href="https://www.w3school.com.cn/tiy/t.asp?f=html_frame_cols">例子</a>中,我们设置了一个<strong>三列</strong>的框架集。第一列被设置为占据浏览器窗口的 25%。第二列被设置为占据浏览器窗口的 50%。第三列被设置为占据浏览器窗口的 25%。HTML 文档 “frame_a.htm” 被置于第一个列中,而 HTML 文档 “frame_b.htm” 被置于第二个列中,而 HTML 文档 “frame_c.htm” 被置于第三个列中。</p> <h4 id="noresize-属性"><a href="#noresize-属性" class="headerlink" title="noresize 属性"></a>noresize 属性</h4><ul> <li>给<frameset>加上noresize&#x3D;”noresize”,则框架是不可调整尺寸的。在框架间的边框上拖动鼠标,你会发现边框是无法移动的。</li> <li>单独给<frame>加上noresize&#x3D;”noresize”,则该框架不可调整尺寸。<figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">html</span>&gt;</span></span><br><span class="line"></span><br><span class="line"><span class="tag">&lt;<span class="name">frameset</span> <span class="attr">cols</span>=<span class="string">&quot;50%,25%,25%&quot;</span>&gt;</span></span><br><span class="line"> <span class="tag">&lt;<span class="name">frame</span> <span class="attr">src</span>=<span class="string">&quot;/example/html/frame_a.html&quot;</span> <span class="attr">noresize</span>=<span class="string">&quot;noresize&quot;</span> /&gt;</span></span><br><span class="line"> <span class="tag">&lt;<span class="name">frame</span> <span class="attr">src</span>=<span class="string">&quot;/example/html/frame_b.html&quot;</span> /&gt;</span></span><br><span class="line"> <span class="tag">&lt;<span class="name">frame</span> <span class="attr">src</span>=<span class="string">&quot;/example/html/frame_c.html&quot;</span> /&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">frameset</span>&gt;</span></span><br><span class="line"></span><br><span class="line"><span class="tag">&lt;/<span class="name">html</span>&gt;</span></span><br></pre></td></tr></table></figure></li> </ul> <hr> <h4 id="rows,cols,colspan,rowspan"><a href="#rows,cols,colspan,rowspan" class="headerlink" title="rows,cols,colspan,rowspan"></a>rows,cols,colspan,rowspan</h4><ul> <li>rows排</li> <li>cols列</li> <li>colspan合并列</li> <li>rowspan合并排</li> </ul> <hr> <h4 id="导航框架"><a href="#导航框架" class="headerlink" title="导航框架"></a>导航框架</h4><p>本例演示如何制作导航框架。导航框架包含一个将第二个框架作为目标的链接列表。名为 “contents.htm” 的文件包含三个链接。</p> <figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">html</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">frameset</span> <span class="attr">cols</span>=<span class="string">&quot;120,*&quot;</span>&gt;</span></span><br><span class="line"> <span class="tag">&lt;<span class="name">frame</span> <span class="attr">src</span>=<span class="string">&quot;/example/html/html_contents.html&quot;</span>&gt;</span></span><br><span class="line"> <span class="tag">&lt;<span class="name">frame</span> <span class="attr">src</span>=<span class="string">&quot;/example/html/frame_a.html&quot;</span> <span class="attr">name</span>=<span class="string">&quot;showframe&quot;</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">frameset</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">html</span>&gt;</span></span><br></pre></td></tr></table></figure> <p><a target="_blank" rel="noopener" href="https://www.w3school.com.cn/example/html/html_contents.html%E4%B8%AD%E4%BB%A3%E7%A0%81%EF%BC%9A">https://www.w3school.com.cn/example/html/html_contents.html中代码:</a></p> <figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">body</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">&quot;/example/html/frame_a, html&quot;</span><span class="attr">target</span>=<span class="string">&quot;showframe&quot;</span>&gt;</span>Frame a<span class="tag">&lt;/<span class="name">a</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">br</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">&quot;/example/html/frame_b. html&quot;</span><span class="attr">target</span>=<span class="string">&quot;showframe&quot;</span>&gt;</span>Frame b<span class="tag">&lt;/<span class="name">a</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">br</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">&quot;/example/html/frame_c. html&quot;</span><span class="attr">target</span>=<span class="string">&quot;showframe&quot;</span>&gt;</span>Frame c<span class="tag">&lt;/<span class="name">a</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">body</span>&gt;</span></span><br></pre></td></tr></table></figure> <h5 id="回顾一下标签中的target属性"><a href="#回顾一下标签中的target属性" class="headerlink" title="回顾一下标签中的target属性"></a>回顾一下<a>标签中的target属性</h5><ul> <li><a target="_blank" rel="noopener" href="https://www.w3school.com.cn/tags/att_a_target.asp">参考</a></li> </ul> <p><strong>在框架中打开窗口</strong><br>不用打开一个完整的浏览器窗口,使用 target 更通常的方法是在一个 <frameset> 显示中将超链接内容定向到一个或者多个框架中。可以将这个内容列表放入一个带有两个框架的文档的其中一个框架中,并用这个相邻的框架来显示选定的文档.</p> <p><strong>举例:</strong></p> <figure class="highlight abnf"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">&lt;frameset cols<span class="operator">=</span><span class="string">&quot;100,*&quot;</span>&gt;</span><br><span class="line"> &lt;frame src<span class="operator">=</span><span class="string">&quot;toc.html&quot;</span>&gt;</span><br><span class="line"> &lt;frame src<span class="operator">=</span><span class="string">&quot;pref.html&quot;</span> name<span class="operator">=</span><span class="string">&quot;view_frame&quot;</span>&gt;</span><br><span class="line">&lt;/frameset&gt; </span><br></pre></td></tr></table></figure> <p>当浏览器最初显示这两个框架的时候,左边这个框架包含目录,右边这个框架包含前言(初始化时就显示在页面右侧的pref.html)。<br>这是 “toc.html” (即:左侧目录)的源代码:</p> <figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">h3</span>&gt;</span>Table of Contents<span class="tag">&lt;/<span class="name">h3</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">ul</span>&gt;</span></span><br><span class="line"> <span class="tag">&lt;<span class="name">li</span>&gt;</span><span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">&quot;pref.html&quot;</span> <span class="attr">target</span>=<span class="string">&quot;view_frame&quot;</span>&gt;</span>Preface<span class="tag">&lt;/<span class="name">a</span>&gt;</span><span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line"> <span class="tag">&lt;<span class="name">li</span>&gt;</span><span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">&quot;chap1.html&quot;</span> <span class="attr">target</span>=<span class="string">&quot;view_frame&quot;</span>&gt;</span>Chapter 1<span class="tag">&lt;/<span class="name">a</span>&gt;</span><span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line"> <span class="tag">&lt;<span class="name">li</span>&gt;</span><span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">&quot;chap2.html&quot;</span> <span class="attr">target</span>=<span class="string">&quot;view_frame&quot;</span>&gt;</span>Chapter 2<span class="tag">&lt;/<span class="name">a</span>&gt;</span><span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line"> <span class="tag">&lt;<span class="name">li</span>&gt;</span><span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">&quot;chap3.html&quot;</span> <span class="attr">target</span>=<span class="string">&quot;view_frame&quot;</span>&gt;</span>Chapter 3<span class="tag">&lt;/<span class="name">a</span>&gt;</span><span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">ul</span>&gt;</span></span><br></pre></td></tr></table></figure> <p>请注意,在文档 “toc.html” 中,每个链接的<strong>目标(target属性值)</strong> 都是 “view_frame”,也就是右边的框架。<br>当用户从左边框架中的目录中选择一个链接时,浏览器会将这个关联的文档载入并显示在右边这个 “view_frame” 框架中。<br><strong>当其他链接被选中时,右边这个框架中的内容也会发生变化,而左边这个框架始终保持不变。</strong></p> <hr> <h4 id="结合我们上文说过的“锚”"><a href="#结合我们上文说过的“锚”" class="headerlink" title="结合我们上文说过的“锚”"></a>结合我们上文说过的“锚”</h4><h4 id="跳转至框架内的一个指定的节"><a href="#跳转至框架内的一个指定的节" class="headerlink" title="跳转至框架内的一个指定的节"></a>跳转至框架内的一个指定的节</h4><h2 id="本例演示两个框架。其中的一个框架设置了指向另一个文件内指定的节的链接。这个”link-htm”文件内指定的节使用-进行标识。-使用框架导航跳转至指定的节本例演示两个框架。左侧的导航框架包含了一个链接列表,这些链接将第二个框架作为目标。第二个框架显示被链接的文档。导航框架其中的链接指向目标文件中指定的节。"><a href="#本例演示两个框架。其中的一个框架设置了指向另一个文件内指定的节的链接。这个”link-htm”文件内指定的节使用-进行标识。-使用框架导航跳转至指定的节本例演示两个框架。左侧的导航框架包含了一个链接列表,这些链接将第二个框架作为目标。第二个框架显示被链接的文档。导航框架其中的链接指向目标文件中指定的节。" class="headerlink" title="本例演示两个框架。其中的一个框架设置了指向另一个文件内指定的节的链接。这个”link.htm”文件内指定的节使用 进行标识。#### 使用框架导航跳转至指定的节本例演示两个框架。左侧的导航框架包含了一个链接列表,这些链接将第二个框架作为目标。第二个框架显示被链接的文档。导航框架其中的链接指向目标文件中指定的节。"></a><a target="_blank" rel="noopener" href="https://www.w3school.com.cn/tiy/t.asp?f=html_frame_jump">本例</a>演示两个框架。其中的一个框架设置了指向另一个文件内指定的节的链接。这个”link.htm”文件内指定的节使用 <a name="C10"> 进行标识。<br><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">html</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">frameset</span> <span class="attr">cols</span>=<span class="string">&quot;20%,80%&quot;</span>&gt;</span></span><br><span class="line"> <span class="tag">&lt;<span class="name">frame</span> <span class="attr">src</span>=<span class="string">&quot;/example/html/frame_a.html&quot;</span>&gt;</span></span><br><span class="line"> <span class="tag">&lt;<span class="name">frame</span> <span class="attr">src</span>=<span class="string">&quot;/example/html/link.html#C10&quot;</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">frameset</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">html</span>&gt;</span></span><br></pre></td></tr></table></figure><br>#### 使用框架导航跳转至指定的节<br><a target="_blank" rel="noopener" href="https://www.w3school.com.cn/tiy/t.asp?f=html_frame_navigation2">本例</a>演示两个框架。左侧的导航框架包含了一个链接列表,这些链接将第二个框架作为目标。第二个框架显示被链接的文档。导航框架其中的链接指向目标文件中指定的节。<br><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">html</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">frameset</span> <span class="attr">cols</span>=<span class="string">&quot;180,*&quot;</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">frame</span> <span class="attr">src</span>=<span class="string">&quot;/example/html/content.html&quot;</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">frame</span> <span class="attr">src</span>=<span class="string">&quot;/example/html/link.html&quot;</span> <span class="attr">name</span>=<span class="string">&quot;showframe&quot;</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">frameset</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">html</span>&gt;</span></span><br></pre></td></tr></table></figure></h2> </div> <footer class="entry-meta entry-footer"> <span class="ico-folder"></span> <a class="article-category-link" href="/categories/HTML%E5%AD%A6%E4%B9%A0/">HTML学习</a>, <a class="article-category-link" href="/categories/%E7%99%BE%E5%BA%A6%E5%89%8D%E7%AB%AF%E6%8A%80%E6%9C%AF%E5%AD%A6%E9%99%A2/">百度前端技术学院</a> <span class="ico-tags"></span> <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/HTML/" rel="tag">HTML</a></li></ul> <div id="comment"> <!-- 来必力City版安装代码 --> <div id="lv-container" data-id="city" data-uid="MTAyMC8yOTQ4MS82MDQ5"> <script type="text/javascript"> (function(d, s) { var j, e = d.getElementsByTagName(s)[0]; if (typeof LivereTower === 'function') { return; } j = d.createElement(s); j.src = 'https://cdn-city.livere.com/js/embed.dist.js'; j.async = true; e.parentNode.insertBefore(j, e); })(document, 'script'); </script> <noscript>为正常使用来必力评论功能请激活JavaScript</noscript> </div> <!-- City版安装代码已完成 --> </div> </footer> <hr class="entry-footer-hr"> </div> <nav id="article-nav"> <a href="/2019/09/22/%E7%99%BE%E5%BA%A6%E5%89%8D%E7%AB%AF%E6%8A%80%E6%9C%AF%E5%AD%A6%E9%99%A2%20%E7%AC%AC%E4%BA%8C%E5%A4%A9%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0%EF%BC%88HTML%EF%BC%89%203/" id="article-nav-newer" class="article-nav-link-wrap"> <strong class="article-nav-caption">上一篇</strong> <div class="article-nav-title"> 百度前端技术学院 第二天学习笔记(HTML)(3) </div> </a> <a href="/2019/09/22/%E7%99%BE%E5%BA%A6%E5%89%8D%E7%AB%AF%E6%8A%80%E6%9C%AF%E5%AD%A6%E9%99%A2%20%E7%AC%AC%E4%BA%8C%E5%A4%A9%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0%EF%BC%88HTML%EF%BC%89/" id="article-nav-older" class="article-nav-link-wrap"> <strong class="article-nav-caption">下一篇</strong> <div class="article-nav-title">百度前端技术学院 第二天学习笔记(HTML)(1)</div> </a> </nav> </article> <!-- Table of Contents --> <aside id="sidebar"> <div id="toc" class="toc-article"> <strong class="toc-title">文章目录</strong> <ol class="nav"><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%8D%95%E5%85%83%E6%A0%BC%E8%BE%B9%E8%B7%9D-Cell-padding"><span class="nav-number">1.</span> <span class="nav-text">单元格边距(Cell padding)</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%8D%95%E5%85%83%E6%A0%BC%E9%97%B4%E8%B7%9D-Cell-spacing"><span class="nav-number">2.</span> <span class="nav-text">单元格间距(Cell spacing)</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E6%9C%89%E5%BA%8F%E5%88%97%E8%A1%A8%EF%BC%88ol%EF%BC%89%E4%B8%8E%E6%97%A0%E5%BA%8F%E5%88%97%E8%A1%A8%EF%BC%88ul%EF%BC%89"><span class="nav-number">3.</span> <span class="nav-text">有序列表(ol)与无序列表(ul)</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#%E6%97%A0%E5%BA%8F%E5%88%97%E8%A1%A8%E4%B8%AD%E7%9A%84%E4%B8%8D%E5%90%8C%E7%B1%BB%E5%9E%8B"><span class="nav-number">3.1.</span> <span class="nav-text">无序列表中的不同类型</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#%E6%9C%89%E5%BA%8F%E5%88%97%E8%A1%A8%E4%B8%AD%E7%9A%84%E4%B8%8D%E5%90%8C%E7%B1%BB%E5%9E%8B"><span class="nav-number">3.2.</span> <span class="nav-text">有序列表中的不同类型</span></a></li></ol></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%AE%9A%E4%B9%89%E5%88%97%E8%A1%A8dl"><span class="nav-number">4.</span> <span class="nav-text">定义列表dl</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%88%86%E7%B1%BB%E5%9D%97%E7%BA%A7%E5%85%83%E7%B4%A0-%E5%85%83%E7%B4%A0"><span class="nav-number">5.</span> <span class="nav-text">分类块级元素:&lt;div&gt;元素</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%88%86%E7%B1%BB%E8%A1%8C%E5%86%85%E5%85%83%E7%B4%A0-%E5%85%83%E7%B4%A0"><span class="nav-number">6.</span> <span class="nav-text">分类行内元素:&lt;span&gt; 元素</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#HTML%E5%B8%83%E5%B1%80"><span class="nav-number">7.</span> <span class="nav-text">HTML布局</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#HTML-%E6%A1%86%E6%9E%B6"><span class="nav-number">8.</span> <span class="nav-text">HTML 框架</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E6%A1%86%E6%9E%B6%E7%BB%93%E6%9E%84%E6%A0%87%E7%AD%BE%EF%BC%88%EF%BC%89"><span class="nav-number">9.</span> <span class="nav-text">框架结构标签(&lt;frameset&gt;)</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E6%A1%86%E6%9E%B6%E6%A0%87%E7%AD%BE%EF%BC%88Frame%EF%BC%89"><span class="nav-number">10.</span> <span class="nav-text">框架标签(Frame)</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#noresize-%E5%B1%9E%E6%80%A7"><span class="nav-number">11.</span> <span class="nav-text">noresize 属性</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#rows%EF%BC%8Ccols%EF%BC%8Ccolspan%EF%BC%8Crowspan"><span class="nav-number">12.</span> <span class="nav-text">rows,cols,colspan,rowspan</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%AF%BC%E8%88%AA%E6%A1%86%E6%9E%B6"><span class="nav-number">13.</span> <span class="nav-text">导航框架</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#%E5%9B%9E%E9%A1%BE%E4%B8%80%E4%B8%8B%E6%A0%87%E7%AD%BE%E4%B8%AD%E7%9A%84target%E5%B1%9E%E6%80%A7"><span class="nav-number">13.1.</span> <span class="nav-text">回顾一下标签中的target属性</span></a></li></ol></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E7%BB%93%E5%90%88%E6%88%91%E4%BB%AC%E4%B8%8A%E6%96%87%E8%AF%B4%E8%BF%87%E7%9A%84%E2%80%9C%E9%94%9A%E2%80%9D"><span class="nav-number">14.</span> <span class="nav-text">结合我们上文说过的“锚”</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E8%B7%B3%E8%BD%AC%E8%87%B3%E6%A1%86%E6%9E%B6%E5%86%85%E7%9A%84%E4%B8%80%E4%B8%AA%E6%8C%87%E5%AE%9A%E7%9A%84%E8%8A%82"><span class="nav-number">15.</span> <span class="nav-text">跳转至框架内的一个指定的节</span></a></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E6%9C%AC%E4%BE%8B%E6%BC%94%E7%A4%BA%E4%B8%A4%E4%B8%AA%E6%A1%86%E6%9E%B6%E3%80%82%E5%85%B6%E4%B8%AD%E7%9A%84%E4%B8%80%E4%B8%AA%E6%A1%86%E6%9E%B6%E8%AE%BE%E7%BD%AE%E4%BA%86%E6%8C%87%E5%90%91%E5%8F%A6%E4%B8%80%E4%B8%AA%E6%96%87%E4%BB%B6%E5%86%85%E6%8C%87%E5%AE%9A%E7%9A%84%E8%8A%82%E7%9A%84%E9%93%BE%E6%8E%A5%E3%80%82%E8%BF%99%E4%B8%AA%E2%80%9Dlink-htm%E2%80%9D%E6%96%87%E4%BB%B6%E5%86%85%E6%8C%87%E5%AE%9A%E7%9A%84%E8%8A%82%E4%BD%BF%E7%94%A8-%E8%BF%9B%E8%A1%8C%E6%A0%87%E8%AF%86%E3%80%82-%E4%BD%BF%E7%94%A8%E6%A1%86%E6%9E%B6%E5%AF%BC%E8%88%AA%E8%B7%B3%E8%BD%AC%E8%87%B3%E6%8C%87%E5%AE%9A%E7%9A%84%E8%8A%82%E6%9C%AC%E4%BE%8B%E6%BC%94%E7%A4%BA%E4%B8%A4%E4%B8%AA%E6%A1%86%E6%9E%B6%E3%80%82%E5%B7%A6%E4%BE%A7%E7%9A%84%E5%AF%BC%E8%88%AA%E6%A1%86%E6%9E%B6%E5%8C%85%E5%90%AB%E4%BA%86%E4%B8%80%E4%B8%AA%E9%93%BE%E6%8E%A5%E5%88%97%E8%A1%A8%EF%BC%8C%E8%BF%99%E4%BA%9B%E9%93%BE%E6%8E%A5%E5%B0%86%E7%AC%AC%E4%BA%8C%E4%B8%AA%E6%A1%86%E6%9E%B6%E4%BD%9C%E4%B8%BA%E7%9B%AE%E6%A0%87%E3%80%82%E7%AC%AC%E4%BA%8C%E4%B8%AA%E6%A1%86%E6%9E%B6%E6%98%BE%E7%A4%BA%E8%A2%AB%E9%93%BE%E6%8E%A5%E7%9A%84%E6%96%87%E6%A1%A3%E3%80%82%E5%AF%BC%E8%88%AA%E6%A1%86%E6%9E%B6%E5%85%B6%E4%B8%AD%E7%9A%84%E9%93%BE%E6%8E%A5%E6%8C%87%E5%90%91%E7%9B%AE%E6%A0%87%E6%96%87%E4%BB%B6%E4%B8%AD%E6%8C%87%E5%AE%9A%E7%9A%84%E8%8A%82%E3%80%82"><span class="nav-number"></span> <span class="nav-text">本例演示两个框架。其中的一个框架设置了指向另一个文件内指定的节的链接。这个”link.htm”文件内指定的节使用 进行标识。123456&lt;html&gt;&lt;frameset cols&#x3D;&quot;20%,80%&quot;&gt; &lt;frame src&#x3D;&quot;&#x2F;example&#x2F;html&#x2F;frame_a.html&quot;&gt; &lt;frame src&#x3D;&quot;&#x2F;example&#x2F;html&#x2F;link.html#C10&quot;&gt;&lt;&#x2F;frameset&gt;&lt;&#x2F;html&gt;#### 使用框架导航跳转至指定的节本例演示两个框架。左侧的导航框架包含了一个链接列表,这些链接将第二个框架作为目标。第二个框架显示被链接的文档。导航框架其中的链接指向目标文件中指定的节。123456&lt;html&gt;&lt;frameset cols&#x3D;&quot;180,*&quot;&gt;&lt;frame src&#x3D;&quot;&#x2F;example&#x2F;html&#x2F;content.html&quot;&gt;&lt;frame src&#x3D;&quot;&#x2F;example&#x2F;html&#x2F;link.html&quot; name&#x3D;&quot;showframe&quot;&gt;&lt;&#x2F;frameset&gt;&lt;&#x2F;html&gt;</span></a> </div> </aside> </section> </div> </div> <!-- <nav id="mobile-nav"> <a href="/" class="mobile-nav-link">主页</a> <a href="/archives" class="mobile-nav-link">归档</a> <a href="/categories" class="mobile-nav-link">分类</a> <a href="/tags" class="mobile-nav-link">标签</a> <a href="/about" class="mobile-nav-link">关于</a> </nav> --> <footer id="footer" class="site-footer"> <div class="clearfix container"> <div class="site-info"> &copy; 2024 珠 All Rights Reserved. <span id="busuanzi_container_site_uv"> 本站访客数<span id="busuanzi_value_site_uv"></span>人次 本站总访问量 <span id="busuanzi_value_site_pv"></span>次 </span> </div> <div class="site-credit"> Theme by <a href="https://github.com/iTimeTraveler/hexo-theme-hipaper" target="_blank">hipaper</a> </div> </div> </footer> <!-- min height --> <script> var wrapdiv = document.getElementById("wrap"); var contentdiv = document.getElementById("content"); wrapdiv.style.minHeight = document.body.offsetHeight - document.getElementById("allheader").offsetHeight - document.getElementById("footer").offsetHeight + "px"; contentdiv.style.minHeight = document.body.offsetHeight - document.getElementById("allheader").offsetHeight - document.getElementById("footer").offsetHeight + "px"; <!-- headerblur min height --> </script> <div style="display: none;"> <script src="https://s11.cnzz.com/z_stat.php?id=1260716016&web_id=1260716016" language="JavaScript"></script> </div> <!-- mathjax config similar to math.stackexchange --> <script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [ ['$','$'], ["\\(","\\)"] ], processEscapes: true } }); </script> <script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code'] } }); </script> <script type="text/x-mathjax-config"> MathJax.Hub.Queue(function() { var all = MathJax.Hub.getAllJax(), i; for(i=0; i < all.length; i += 1) { all[i].SourceElement().parentNode.className += ' has-jax'; } }); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script> <link rel="stylesheet" href="/fancybox/jquery.fancybox.css"> <script src="/fancybox/jquery.fancybox.pack.js"></script> <script src="/js/script.js"></script> <script src="/js/bootstrap.js"></script> <script src="/js/main.js"></script> <div style="display: none;"> <script src="https://s95.cnzz.com/z_stat.php?id=1260716016&web_id=1260716016" language="JavaScript"></script> </div> <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"> </script> </div> <a id="rocket" href="#top" class=""></a> <script type="text/javascript" src="/js/totop.js" async=""></script> </body> </html>