当前位置: 首页 > 网络学院 > 网页制作基础教程 > HTML > HTML 介绍

HTML
HTML 介绍
HTML 元素
HTML 基本标签
HTML 格式
HTML 实体字符
HTML 链接
HTML 框架
HTML 表格
HTML 列表
HTML 表单
HTML 图片
HTML 背景
HTML 颜色
HTML 颜色值
HTML 颜色名
HTML 便条
HTML 布局
HTML 字体
HTML 4.0
HTML 样式

HTML 介绍


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-01   浏览: 2061 ::
收藏到网摘: n/a

What is an HTML File?
什么是HTML文件?

  • HTML stands for Hyper Text Markup Language
    HTML
    是超文本标记语言的缩写
  • An HTML file is a text file containing small markup tags
    HTML
    文件是包含标记标签的文本文件
  • The markup tags tell the Web browser how to display the page
    标记标签可让浏览器了解怎样去显示这个页面
  • An HTML file must have an htm or html file extension
    HTML
    文件必须以 htm html 为文件扩展名
  • An HTML file can be created using a simple text editor
    使用普通的文字编辑器可以建立HTML文件

Do You Want to Try It?
你想尝试一下吗?

If you are running Windows, start Notepad.
如果你使用的是WINDOWS操作系统,请打开记事本。

If you are on a Mac start SimpleText.
如果你使用的是苹果机请打开SimpleText程序

In OSX start TextEdit and change the following preferences: Open the the "Format" menu and select "Plain text" instead of "Rich text". Then open the "Preferences" window under the "Text Edit" menu and select "Ignore rich text commands in HTML files". Your HTML code will probably not work if you do not change the preferences above!
如是OSX系统, 请使用TextEdit并改变以下参数: 选择 (在属性窗口) "纯文本" 变为 "多元文本" , 然后再选择 "Ignore rich text commands in HTML files". 这步十分关键, 如果不做的话就无法让HTML代码起作用。

Type in the following text:
输入以下内容:

<html>
<head>
<title>Title of page</title>
</head>
<body>

This is my first homepage. <b>This text is bold</b>
</body>
</html>

Save the file as "mypage.htm".
将文件保存为"mypage.htm"

Start your Internet browser. Select "Open" (or "Open Page") in the File menu of your browser. A dialog box will appear. Select "Browse" (or "Choose File") and locate the HTML file you just created - "mypage.htm" - select it and click "Open". Now you should see an address in the dialog box, for example "C:MyDocumentsmypage.htm". Click OK, and the browser will display the page.
打开你的浏览器. 在你的浏览器文件菜单中选择 "打开" ( "打开页面") . 出现一个对话框. 选择 "浏览器" ( "选择文件") 再选中你建立的文件 - "mypage.htm" - 点击 "打开". 这时地址栏中会出现文件的地址, 比如 "C:MyDocumentsmypage.htm". 浏览器窗口内会显示页面内容.


Example Explained
解析实例

The first tag in your HTML document is <html>. This tag tells your browser that this is the start of an HTML document. The last tag in your document is </html>. This tag tells your browser that this is the end of the HTML document.
HTML
文档中的第一个标签为 <html>. 该标签传达给浏览器的信息:这是HTML代码开始的位置. 由此可知 </html>HTML代码结束的位置.

The text between the <head> tag and the </head> tag is header information. Header information is not displayed in the browser window.
<head> </head> 标签之间的内容是这个HTML的顶部信息,它不会显示在浏览器窗口内.

The text between the <title> tags is the title of your document. The title is displayed in your browser's caption.
<title> </title> 标签之间的内容是这个HTML文档的标题信息,内容会出现在浏览器的标题栏.

The text between the <body> tags is the text that will be displayed in your browser.
<body> </body> 标签之间的内容为文档的主要显示内容,会出现在浏览器窗口内

The text between the <b> and </b> tags will be displayed in a bold font.
<b> </b> 之间的内容会以粗字体显示


HTM or HTML Extension?
HTM扩展名还是HTML

When you save an HTML file, you can use either the .htm or the .html extension. We have used .htm in our examples. It might be a bad habit inherited from the past when some of the commonly used software only allowed three letter extensions.
你可以选择其中任意一个,效果是一样的. 这里使用.htm扩展只是举个例子.有些软件只能打开3个字符的扩展名时就使用.htm

With newer software we think it will be perfectly safe to use .html.
如使用比较新的软件, .html更为妥当


Note on HTML Editors:
有关HTML编辑器的提示

You can easily edit HTML files using a WYSIWYG (what you see is what you get) editor like FrontPage, Claris Home Page, or Adobe PageMill instead of writing your markup tags in a plain text file.
你可用WYSIWYG(所见即所得)FrontPage这样的编辑器来轻松编辑HTML文件

But if you want to be a skillful Web developer, we strongly recommend that you use a plain text editor to learn your primer HTML.
但你想成为熟练的WEB开发人员,我们强烈推荐你使用纯文字编辑器来学习HTML


Frequently Asked Questions
常见问答

Q: After I have edited an HTML file, I cannot view the result in my browser. Why?
A:
Make sure that you have saved the file with a proper name and extension like "c:mypage.htm". Also make sure that you use the same name when you open the file in your browser.

问:我已经编辑了HTML文件,为什么却无法在我的浏览器里查看呢?
答:你是否恰当地保存了文件?文件名是否正确?浏览器的地址是否正确?

Q: I have tried to edit an HTML file but the changes don't show in the browser. Why?
A:
The browser caches your pages so it doesn't have to read the same page twice. When you have changed a page, the browser doesn't know that. Use the browser's refresh/reload button to force the browser to read the edited page.

问:我已经修改了HTML文件但为什么浏览器里的结果没有改变?
答:浏览器缓存已经保存了你修改前的页面,要让浏览器重新加载信息请点"刷新"

Q: What browser should I use?
A:
You can do all the training with all of the common browsers, like Internet Explorer, Mozilla, Netscape, or Opera. However, some of the examples in our advanced classes require the latest versions of the browsers.

问:我应该使用哪款浏览器呢?
答:你可以用目前市场上流行的任何一款浏览器,如IEMOZILLANETSCAPEOPERA。但一些实例演示需要使用最新版本的浏览器。

Q: Does my computer have to run Windows? What about a Mac?
A:
You can do all your training on a non-Windows computer like a Mac. However, some of the examples in our advanced classes require a newer version of Windows, like Windows 98 or Windows 2000.

问:是不是我必须在WINDOWS操作系统下才行?是MAC该怎么办?
答:有些实例需要较新版本的WINDOWS系统,一般的实例可以在非WINDOWS操作系统下完成。

评论 (16) 1 2 3 4 All

登陆 | 还没注册?