HTML的作用告诉浏览器文档的结构。用特定的语句(标签)让浏览器知道哪里是标题、段落、等,使得它能够按照我们的意思来显示,用来与浏览器交流的语言。
基本的语句:HTML的结构分为两大部分,一个是<head>,另一个是<body>,它们全部都属于<HTML>的一部分。通常<head>里面比较简单,一般用来控制页面的标题,和页面的style。而页面上基本的显示一般都在<body>里面,页面的标题,段落等都由<body>里面特定的标签来显示。为了使得页面更加人性化,通过src来给页面增加图片,通过href来给文字或图片增加链接,更加详细的解释我们想介绍的东西。
开始创建网页时,像写一篇文章一样,都有一定的结构,要列出提纲,所以,先一般要计划好网页的结构,绘制出略图,再开始写HTML。这时候要分清内联元素和块元素,块元素用于把网页分成几大块,然后用内联元素使得段落里面按照我们想要的方式来显示。
为了结构更加分明,一般就开始给每块结构取一个名字,便于分别和操作,一般用元素<a>来创建,然后链接到目标锚,通过不同的锚来管理每个块结构。这样一个简单的网页页面就成功了。
还有一些问题,问题一就是要使得我们做的页面能放到网上,我们的朋友,七大姑,八大婶,还有不认识我们的人能看到我们做的东西的时候,就要做以下几个步骤:① 找一个主机代理商。 ②选择网站的名字。③ 寻找把文件从电脑传到主机的途径。④把网站名告诉所有想告诉的人。问题二,你的七大姑八大婶还有所有认识不认识的人基本没有可能用同样的一种浏览器,不同的浏览器有不同的特性,使得他们见到的不是同一个你想给他们看的那个网页,所以就要有一个统一的标准、规范,使得所有的浏览器显示的都是一样的。下面这个语句是对文档进行的一个定义。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
这样一个基本的由HTML做的页面就成功了,如下例:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>My Trip Around the USA on a Segway</title>
</head>
<body>
<h1>Segway'n USA</h1>
<p>
Documenting my trip around the US on my very own Segway!
</p>
<h2>August 20, 2005</h2>
<p><img src="images/segway2.jpg" alt="Me any my Segway in New Mexico" /></p>
<p>
Well I made it 1200 miles already, and I passed
through some interesting places on the way:
</p>
<ol>
<li>Walla Walla, WA</li>
<li>Magic City, ID</li>
<li>Bountiful, UT</li>
<li>Last Chance, CO</li>
<li>Truth or Consequences, NM</li>
<li>Why, AZ</li>
</ol>
<h2>July 14, 2005</h2>
<p>
I saw some Burma Shave style signs on the side of the
road today:
</p>
<blockquote>
<p>
Passing cars, <br />
When you can't see, <br />
May get you, <br />
A glimpse, <br />
Of eternity. <br />
</p>
</blockquote>
<p>
I definitely won't be passing any cars.
</p>
<h2>June 2, 2005</h2>
<p><img src="images/segway1.jpg" alt="The first day of the trip" /></p>
<p>
My first day of the trip! I can't believe I finally got
everything packed and ready to go. Because I'm on a Segway,
I wasn't able to bring a whole lot with me:
</p>
<ul>
<li>cellphone</li>
<li>iPod</li>
<li>digital camera</li>
<li>and a protein bar</li>
</ul>
<p>
Just the essentials. As
Lao Tzu would have said, <q>A journey of a
thousand miles begins with one Segway.</q>
</p>
</body>
</html>