HTML 快速指南

简介: 快速指南本章节提供了 HTML 最常用标签的简单实用示例。你可以将其当做速查手册。基础这是文章标题这是标题 1这是标题 2这是标题 3这是标题 4这是标题 5这是标题 6这是段落 样式粗体文本斜体文本下划线文本定义着重文字定义加重语气定义...

快速指南

本章节提供了 HTML 最常用标签的简单实用示例。

你可以将其当做速查手册。

基础

<!DOCTYPE html>
<html>
<head>
<title>这是文章标题</title>
</head>
<body>
<!-- 这是注释 -->
<h1>这是标题 1</h1>
<h2>这是标题 2</h2>
<h3>这是标题 3</h3>
<h4>这是标题 4</h4>
<h5>这是标题 5</h5>
<h6>这是标题 6</h6>
<p>这是段落</p>
<br> <!-- 这是换行 -->
<hr> <!-- 这是分割线 -->
</body>
</html>

样式

<b>粗体文本</b>
<i>斜体文本</i>
<u>下划线文本</u>
<em>定义着重文字</em><br />
<strong>定义加重语气</strong><br />
<ins>定义插入字</ins><br />
<sub>定义删除字</sub><br />
<sub>上标</sub>
<sup>下标</sup>

<!-- 计算机样式 -->
<pre>预格式文本</pre>
<code>一段电脑代码</code>
<dfn>定义项目</dfn>
<kbd>键盘输入</kbd>
<samp>计算机样本</samp>
<var>变量</var>

<!-- 特殊含义的样式 -->
<address>
  Written by <a href="mailto:webmaster@example.com">Jon Doe</a>.<br>
  Visit us at:<br>
  Example.com<br>
  Box 564, Disneyland<br>
  USA
</address>

<!-- 该段落文字从左到右显示 -->
<bdo dir="rtl">该段落文字从右到左显示</bdo>

<!-- 长的引用语 -->
<blockquote cite="http://www.worldwildlife.org/who/index.html">
  For 50 years, WWF has been protecting the future of nature. The world's leading conservation organization, WWF works
  in 100 countries and is supported by 1.2 million members in the United States and close to 5 million globally.
</blockquote>

<!-- 短的引用语 -->
WWF's goal is to: <q>Build a future where people live in harmony with nature.</q>

<!-- 定义引用、引证 -->
<p><cite>The Scream</cite> by Edward Munch. Painted in 1893.</p>
<dfn>定义项目</dfn>

链接、锚点、图片

<a href="http://www.example.com/">This is a Link</a>
<a href="http://www.example.com/"><img src="URL" alt="Alternate Text"></a>
<a href="mailto:webmaster@example.com">Send e-mail</a>A named anchor:
<a name="tips">Useful Tips Section</a>
<a href="#tips">Jump to the Useful Tips Section</a>

列表

<!-- 无序列表 -->
<ul>
<li>First item</li>
<li>Next item</li>
</ul>

<!-- 有序列表 -->
<ol>
<li>First item</li>
<li>Next item</li>
</ol>

<!-- 自定义列表 -->
<dl>
<dt>First term</dt>
<dd>Definition</dd>
<dt>Next term</dt>
<dd>Definition</dd>
</dl>

表单

<form action="http://www.example.com/test.asp" method="post/get">
<input type="text" name="lastname"
value="Nixon" size="30" maxlength="50">
<input type="password">
<input type="checkbox" checked="checked">
<input type="radio" checked="checked">
<input type="submit">
<input type="reset">
<input type="hidden">
<select>
<option>Apples
<option selected>Bananas
<option>Cherries
</select>
<textarea name="Comment" rows="60" cols="20"></textarea>
</form>

表格

<table border="1">
  <caption>Monthly Savings</caption>
  <colgroup>
    <col span="1" style="background-color:#dcdcdc">
    <col style="background-color:#00bfff">
  </colgroup>
  <thead>
  <tr>
    <th>Month</th>
    <th>Savings</th>
  </tr>
  </thead>
  <tfoot>
  <tr>
    <td>Sum</td>
    <td>$180</td>
  </tr>
  </tfoot>
  <tbody>
  <tr>
    <td>January</td>
    <td>$100</td>
  </tr>
  <tr>
    <td>February</td>
    <td>$80</td>
  </tr>
  </tbody>
</table>

区块

<div style="color:#0000FF">
  <h3>这是一个在 div 元素中的标题。</h3>
  <p>这是一个在 div 元素中的文本。</p>
</div>

<p><span style="color:red">some text.</span>some other text.</p>

框架

<iframe src="http://www.runoob.com">
  <p>您的浏览器不支持  iframe 标签。</p>
</iframe>
目录
相关文章
|
2月前
|
数据格式
什么是HTML?
【8月更文挑战第27天】什么是HTML?
16 2
|
3月前
|
前端开发 信息无障碍 开发者
HTML4(二)(上)
HTML4(二)(上)
39 0
|
3月前
|
移动开发 前端开发 iOS开发
HTML
HTML
73 0
|
4月前
|
前端开发 数据安全/隐私保护
HTML总结
块级元素各占据一行,垂直方向排列;块级元素以新行开始,以换行结束。内联元素在显示时通常不会以新行开始,相邻的行内元素会排列在同一行例,直到一行排不下才会换行。 块级元素可以包含行内元素和块级元素。行内元素不能包含块级元素。 行内元素与块级元素属性的不同,主要是盒模型属性上:行内元素设置width无效,height无效,其宽度随元素的内容而变化,margin上下无效,padding上下无效。块级元素可以设置宽、高,盒模型各属性也均能成功设置。
17 0
|
前端开发 C++ Windows
HTML详解连载(1)
HTML详解连载(1)
|
11月前
html空格符
html空格符
|
前端开发 JavaScript 数据安全/隐私保护
HTML详解连载(3)
HTML详解连载(3)
|
前端开发 安全 数据安全/隐私保护
HTML大总结(四)
HTML大总结(四)
179 0
HTML大总结(四)
|
前端开发
HTML大总结(二)
HTML大总结(二)
90 0
HTML大总结(二)
|
Web App开发 移动开发 前端开发
HTML初识
HTML初识
102 0