HTML部分
<html>
<head>
<title>Title of page</title>
</head>
<body>
This is my first homepage.
<b>This text is bold</b>
</body>
</html>
HTML文档中,第一个标签是<html>。这个标签告诉浏览器这是HTML文档的开始。HTML文档的最后一个标签是</html>,这个标签告诉浏览器这是HTML文档的终止。
在<head>和</head>标签之间文本的是头信息。在浏览器窗口中,头信息是不被显示的。
在<title>和</title>标签之间的文本是文档标题,它被显示在浏览器窗口的标题栏。
在<body>和</body>标签之间的文本是正文,会被显示在浏览器中。
在<b>和</b>标签之间的文本会以加粗字体显示。段落是用<p>标签定义的。
当需要结束一行,并且不想开始新段落时,使用<br>标签。<br>标签不管放在什么位置,都能够强制换行。<br>标签是一个空标签,它没有结束标记。
水平线<hr>标签
<body bgcolor="red">
背景颜色bgcolor
<table border="0">
表格无边框
<h1>This is a heading</h1>
<h2>This is a heading</h2>
<h3>This is a heading</h3>
<h4>This is a heading</h4>
<h5>This is a heading</h5>
<h6>This is a heading</h6>
标题元素由标签<h1>到<h6>定义。<h1>定义了最大的标题元素,<h6>定义了最小的。
<!-- This is a comment -->
<h1 align="center">This is heading 1</h1>
居中align="center"
地址书写:
<address>
Donald Duck<br>
BOX 555<br>
Disneyland<br>
USA
</address>
删除和插入文字:
<del>twenty </del>
<ins>twelve </ins>
想要在HTML文档中显示一个小于号,我们必须这样写:<或者<
想要在HTML中插入空格,可以使用实体:
显示结果 描述 实体名 实体号
不可拆分的空格  
< 小于 < <
> 大于 > >
& and符号 & &
" 引号 " "
' 单引号 '
<a href="http://www.microsoft.com/">This text</a>
超链接This text是蓝色的
<a href="lastpage.htm">
<img border="0" src=".\images\next.gif">
</a>
图片作为超链接
锚<a>可以指向网络上的任何资源:HTML页面,图像,声音,影片等
标签<a>被用来创建一个链接指向的锚,href属性用来指定连接到的地址,在锚的起始标签<a>和结束标签</a>中间的部分将被显示为超级链接。
打开一个新的浏览器窗口来打开链接:
<a href="http://www.w3schools.com/" target="_blank">Visit W3Schools!</a>
如何跳转到一个文档的某部分
<html>
<body>
<p>
<a href="#C4">
See also Chapter 4.
</a>
</p>
<p>
<h2>Chapter 1</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 2</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 3</h2>
<p>This chapter explains ba bla bla</p>
<a name="C4"><h2>Chapter 4</h2></a>
<p>This chapter explains ba bla bla</p>
</body>
</html>
假如你的页面在框架中,如何跳出框架:
<html>
<body>
<p>Locked in a frame?</p>
<a href="http://www.w3schools.com/" target="_top">Click here!</a>
</body>
</html>
垂直分栏:
<html>
<frameset cols="25%,50%,25%">
<frame src="frame_a.htm">
<frame src="frame_b.htm">
<frame src="frame_c.htm">
</frameset>
</html>
水平分栏:
<html>
<frameset rows="25%,50%,25%">
<frame src="frame_a.htm">
<frame src="frame_b.htm">
<frame src="frame_c.htm">
</frameset>
</html>
<html>
<head>
<title>Title of page</title>
</head>
<body>
This is my first homepage.
<b>This text is bold</b>
</body>
</html>
HTML文档中,第一个标签是<html>。这个标签告诉浏览器这是HTML文档的开始。HTML文档的最后一个标签是</html>,这个标签告诉浏览器这是HTML文档的终止。
在<head>和</head>标签之间文本的是头信息。在浏览器窗口中,头信息是不被显示的。
在<title>和</title>标签之间的文本是文档标题,它被显示在浏览器窗口的标题栏。
在<body>和</body>标签之间的文本是正文,会被显示在浏览器中。
在<b>和</b>标签之间的文本会以加粗字体显示。段落是用<p>标签定义的。
当需要结束一行,并且不想开始新段落时,使用<br>标签。<br>标签不管放在什么位置,都能够强制换行。<br>标签是一个空标签,它没有结束标记。
水平线<hr>标签
<body bgcolor="red">
背景颜色bgcolor
<table border="0">
表格无边框
<h1>This is a heading</h1>
<h2>This is a heading</h2>
<h3>This is a heading</h3>
<h4>This is a heading</h4>
<h5>This is a heading</h5>
<h6>This is a heading</h6>
标题元素由标签<h1>到<h6>定义。<h1>定义了最大的标题元素,<h6>定义了最小的。
<!-- This is a comment -->
<h1 align="center">This is heading 1</h1>
居中align="center"
地址书写:
<address>
Donald Duck<br>
BOX 555<br>
Disneyland<br>
USA
</address>
删除和插入文字:
<del>twenty </del>
<ins>twelve </ins>
想要在HTML文档中显示一个小于号,我们必须这样写:<或者<
想要在HTML中插入空格,可以使用实体:
显示结果 描述 实体名 实体号
不可拆分的空格  
< 小于 < <
> 大于 > >
& and符号 & &
" 引号 " "
' 单引号 '
<a href="http://www.microsoft.com/">This text</a>
超链接This text是蓝色的
<a href="lastpage.htm">
<img border="0" src=".\images\next.gif">
</a>
图片作为超链接
锚<a>可以指向网络上的任何资源:HTML页面,图像,声音,影片等
标签<a>被用来创建一个链接指向的锚,href属性用来指定连接到的地址,在锚的起始标签<a>和结束标签</a>中间的部分将被显示为超级链接。
打开一个新的浏览器窗口来打开链接:
<a href="http://www.w3schools.com/" target="_blank">Visit W3Schools!</a>
如何跳转到一个文档的某部分
<html>
<body>
<p>
<a href="#C4">
See also Chapter 4.
</a>
</p>
<p>
<h2>Chapter 1</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 2</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 3</h2>
<p>This chapter explains ba bla bla</p>
<a name="C4"><h2>Chapter 4</h2></a>
<p>This chapter explains ba bla bla</p>
</body>
</html>
假如你的页面在框架中,如何跳出框架:
<html>
<body>
<p>Locked in a frame?</p>
<a href="http://www.w3schools.com/" target="_top">Click here!</a>
</body>
</html>
垂直分栏:
<html>
<frameset cols="25%,50%,25%">
<frame src="frame_a.htm">
<frame src="frame_b.htm">
<frame src="frame_c.htm">
</frameset>
</html>
水平分栏:
<html>
<frameset rows="25%,50%,25%">
<frame src="frame_a.htm">
<frame src="frame_b.htm">
<frame src="frame_c.htm">
</frameset>
</html>