HTML语言基础

HTML语言基础:

<!--要注释的内容 --> 注释

<!DOCTYPE>  声明html文档

<h1--h6>  标题声明

<p>  文字编辑 <b> 文字加粗 </b>  </p>

<ul>  文字编辑 <b> 文字加粗 </b>  </p>

<a herf="http://www.....">  页面连接

<abbr>  <p>The <abbr title="World Health Organization">WHO</abbr> was founded in 1948.</p>    The WHO was founded in 1948.   缩写

<acronym>  Can I get this <acronym title="as soon as possible">ASAP</acronym>?  Can I get this ASAP?  首字母缩略

<address>  

Written by <a href="mailto:webmaster@example.com">xiao lang</a>.<br>

Visit us at:<br>

Example.com<br>

Box 564, Disneyland<br>

USA

</address>  邮箱

<area>   <area shape="circle" coords="90,58,3" alt="Mercury" href="mercur.htm">  区域操作

<article> 标签定义独立的内容。  独立于文档其他内容

<audio>  播放暂停音量按钮  标签定义声音,比如音乐或其他音频流。

目前,支持的3种文件格式:MP3WavOgg

<base href="//www.runoob.com//images/" target="_blank"> 指定了页面上所有链接的默认 URL,定义href属性等  

注意:HTML 旨在显示信息,而 XML 旨在传输信息。

1.HTML 基本文档

  <!DOCTYPE html>

  <html>

  <head>

  <title>文档标题</title>

  </head>

  <body>

    可见文本...

  </body>

  </html>

2.基本标签(Basic Tags

  <h1>最大的标题</h1>

  <h2> . . . </h2>

  <h3> . . . </h3>

  <h4> . . . </h4>

  <h5> . . . </h5>

  <h6>最小的标题</h6>

  <p>这是一个段落。</p>

  <br> (换行)

  <hr> (水平线)

  <!-- 这是注释 -->

3.文本格式化(Formatting

  <b>粗体文本</b>

  <code>计算机代码</code>

  <em>强调文本</em>

  <i>斜体文本</i>

  <kbd>键盘输入</kbd>

  <pre>预格式化文本</pre>

  <small>更小的文本</small>

  <strong>重要的文本</strong>

  <abbr> (缩写)

  <address> (联系信息)

  <bdo> (文字方向)

  <blockquote> (从另一个源引用的部分)

  <cite> (工作的名称)

  <del> (删除的文本)

  <ins> (插入的文本)

  <sub> (下标文本)

  <sup> (上标文本)

4.链接(Links

  普通的链接:<a href="http://www.example.com/">链接文本</a>

  图像链接: <a href="http://www.example.com/"><img src="URL" alt="替换文本"></a>

  邮件链接: <a href="mailto:webmaster@example.com">发送e-mail</a>

5.书签:

  <a id="tips">提示部分</a>

  <a href="#tips">跳到提示部分</a>

6.图片(Images

  <img src="URL" alt="替换文本" height="42" width="42">

7.样式/区块(Styles/Sections

  <style type="text/css">

    h1 {color:red;}

    p {color:blue;}

  </style>

  <div>文档中的块级元素</div>

  <span>文档中的内联元素</span>

8.无序列表

  <ul>

      <li>项目</li>

      <li>项目</li>

  </ul>

9.有序列表

  <ol>

      <li>第一项</li>

      <li>第二项</li>

  </ol>

10.定义列表

  <dl>

    <dt>项目 1</dt>

      <dd>描述项目 1</dd>

    <dt>项目 2</dt>

      <dd>描述项目 2</dd>

  </dl>

11.表格(Tables

  <table border="1">

    <tr>

      <th>表格标题</th>

      <th>表格标题</th>

    </tr>

    <tr>

      <td>表格数据</td>

      <td>表格数据</td>

    </tr>

  </table>

12.框架(Iframe

  <iframe src="demo_iframe.htm"></iframe>

13.表单(Forms

  <form action="demo_form.php" method="post/get">

  <input type="text" name="email" size="40" maxlength="50">

  <input type="password">

  <input type="checkbox" checked="checked">

  <input type="radio" checked="checked">

  <input type="submit" value="Send">

  <input type="reset">

  <input type="hidden">

  <select>

  <option>苹果</option>

  <option selected="selected">香蕉</option>

  <option>樱桃</option>

  </select>

  <textarea name="comment" rows="60" cols="20"></textarea> 

  </form>

14.实体(Entities 

  &lt;等同于 <

  &gt;等同于 >

  &#169;等同于 ©

支持个人观看使用,如商用或转载,请告知! -----萧朗(QQ:453929789 Email:xiaolang_xl@sina.com)
原文地址:https://www.cnblogs.com/XiaoLang0/p/12187658.html