Basic HTML Tutorial (1)--html Introduction

Source: Internet
Author: User

What is an HTML file?
  • HTML refers to hypertext tag language.
  • An HTML file is a text file that contains some labels.
  • These tags tell the WEB browser how to display the page.
  • The HTML file must use the HTM or HTML as the file name extension.
  • HTML files can be created using a simple text editor.

How about doing an experiment?

First step: If you are using Windows, start Notepad.

If you use a Mac, start SimpleText.

(in OSX, use TextEdit and set parameters: Select the Plain text font in the parameter settings instead of the rich text font, and then select Ignore Rich Text command in HTML file.) This is important because, if not, the HTML code may not work correctly. )

Step Two: Type the following text:

<HTML>   <Head>      <title>Title of the page</title>   </Head>   <Body>      <P>This is my first page.<b>This is bold text.</b></P>   </Body></HTML>

Step three: Save this file as "mypage.html".

Fourth step: Start your browser. Select "Open" or "open page" from the File menu in the browser. A dialog box will pop up. Click Browse or select file to locate the file you just created-"mypage.html", select it and open it, and now you'll see a line of addresses in the dialog box, such as "D:\mypage.html". Click the OK button and the browser will display this page.

Example Explanation:

The first tag in the HTML file is

The text that is located between the

The text in the <title> tag is the title of the file. The title is displayed in the browser's title bar.

The text in the <body> tag is the text that will be displayed by the browser.

The text in the <b> and </b> tags is displayed in bold.

Why should we use lowercase tags?

We just talked about: theHTML tag is insensitive to case :<b> and the same as <B> 's role. When you surf the Web, you'll find that most tutorials use uppercase HTML tags in their examples. And we always use lowercase. What is the reason?

If you want to be prepared to use next-generation HTML, you should use lowercase tags. The World Wide Web Consortium has the following criteria: It is recommended to use lowercase tags in html 4, whereas in XHTML (Next generation HTML), lowercase tags must be used.

HTM or HTML extension?

When you save an HTML file, you can use the HTM or use HTML as the extension. We just used the. htm as the extension for the example above. But this may be a bad habit, and the people who are accustomed to doing so may develop the bad habit of using some outdated software that only allows three letters to be used as extensions.

If you use the latest software, we think that using. html is a fairly safe approach.

Considerations for the HTML editor:

You can use the WYSIWYG editor instead of the plain text editor, which makes it easier to edit HTML files. Let's say FrontPage, Claris Home Page, or Adobe pagemill, or even higher-order Dreamweaver.

However, if you want to become a skilled developer, we strongly recommend that you use a plain text editor to learn about our basic HTML tutorial.

FAQs (FAQ)

Q: I have edited an HTML file, but the browser cannot display the results. Why?

A: First make sure you use the correct file name and extension to save, say "c:\mypage.htm". Then check to see if the same file name is used in the browser to open it.

Q: I have edited the HTML file again, but the display of the browser has not changed. Why?

A: In order to not read the same page repeatedly, the browser will cache your page. The browser will not realize that you have modified the page. By using the Refresh or Reload button, you can have the browser read the edited page.

Q: What browser should I use?

A: You can use any generic browser for training, such as Internet Explorer, Mozilla, Netscape, or Opera. However, some examples of our advanced courses require the support of the latest version of the browser.

Q: Does my computer have to run Windows? Can I use a Mac machine?

A: You can do all the training on a non-Windows system, such as a Mac.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.