HTML 基础学习笔记

1.增长一个标题
<title>My first HTML document</title>

 

这个时候用浏览器打开文件其实只是一片空白。
2.添加头部和文件
HTML中有6个级别的头字体。H1是最重要的,H2次之,一直到H6
每个片断都应该有<p>的标签.
<h1>An important heading</h1>
<h2>A slightly less important heading</h2>
 
<p>This is the first paragraph.</p>
 
<p>This is the second paragraph.</p>
 
 
3.增长一些强调
This is a really <em>interesting</em> topic!
可是在这我也不加上<p>的标签,也仍是会展现,因此我猜应该是默认的吧?
4.增长图片到你的页面中
<p><img src="text.png" width="200" height="150" alt="My friend Peter"></p>
图片能够指定长宽的像素大小, 也能够增长替换表达,当这个图像不存在的时候(alt)。
 
 
longdesc 几乎全部的网页都不支持这个标签了。
5.增长到其余页面的连接
This is a link to <a href="peter.html">Peter's page</a>
 
 
连接到其余的网页:
This is a link to <a href="http://www.w3.org/">W3C</a>.
你也能够将一个图片连接到一个地址:
<a href="peter.html"><img src="text.png" alt="My friend Peter"></a>
6.三种列表
Html支持三种列表
 
 
 
 
(1)无序列表 ul
<ul>
  <li>the first list item</li>
  <li>the second list item</li>
  <li>the third list item</li>
</ul>

 
(2)有序列表 ol
 
 
 
 
<ol>
  <li>the first list item</li>
  <li>the second list item</li>
  <li>the third list item</li>
</ol>
 
上面这两种都是</ol>是必须的而</li>是可选的。
(3)第三个是定义列表,这个列表容许你增长定义。dt 表示每一项,而dd表示定义。
<dl>
  <dt>the first term</dt>
  <dd>its definition</dd>
  <dt>the second term</dt>
  <dd>its definition</dd>
  <dt>the third term</dt>
  <dd>its definition</dd>
</dl>
同时这些列表都是能够嵌套的。
 
7.HTML有一个头部和身体部
若是你使用浏览器的预览页面源代码的功能,可看到HTML页面。这个文件一般是又一个申明什么版本的HTML被使用而开始的。而后是<html><head>的标签,而后就是在最后面</html>。<html></html> 如同一个容器同样。 <head> ... </head>  包含了标签。<body> ... </body> 包含了标记以及可见的内容。
8.整理你的标记
一个自动休整标记错误的工具是:
 
 
以上,而后这个都是介绍的HTML4.0来着,若是有详细须要仍是看 
http://www.w3school.com.cn 吧。。。
 ps一个本身写的html做为结束:
<html>
<head>
<title>My first HTML document</title>
</head>
<body>
<h1>An important heading</h1>
<h2>A slightly less important heading</h2>
<p>This is the first paragraph.</p>

This is the second paragraph.
This is a really <em>interesting</em> topic!
 <p><img src="text.png" width="200" height="150" alt="My friend Peter"></p>
 This is a link to <a href="peter.html">Peter's page</a>

 This is a link to <a href="http://www.w3.org/">W3C</a>.
<a href="peter.html"><img src="text.png" alt="My friend Peter"></a>

<ul>
  <li>the first list item</li>
  <li>the second list item</li>
  <li>the third list item</li>
</ul>

<ol>
  <li>the first list item</li>
  <li>the second list item</li>
  <li>the third list item</li>
</ol>

<dl>
  <dt>the first term</dt>
  <dd>its definition</dd>
  <dt>the second term</dt>
  <dd>its definition</dd>
  <dt>the third term</dt>
  <dd>its definition</dd>
</dl>
</body>
</html>
相关文章
相关标签/搜索