Home >Web Front-end >HTML Tutorial >Novices learn old knowledge (1) HTML language basics

Novices learn old knowledge (1) HTML language basics

黄舟
黄舟Original
2016-12-26 15:08:211476browse

1. Why?

In the past two years, many companies have developed graphical HTML development tools, making web page production very simple. Editing tools such as Microsoft FrontPage launched by Microsoft, Adobe Pagemill launched by Adobe, and Dreamweaver launched by Micromedia are all called "What You See Is What You Get" tools. These graphical development tools can directly process web pages without writing laborious markup. This allows users to write web pages without any basic knowledge of HTML language. At this time, the task of writing HTML documents is completed for you by the development tools. This is the greatest success of web graphics editing tools, but it is also their greatest shortcoming. Constrained by the graphics editing tool itself, a large amount of junk code will be generated. The reason is very simple. Let me give you a simple example and you will understand. For example: when designing a table on a web page, if the width and height of each cell are automatically determined based on the content, HTML only needs you to tell it the order of the table and cells (that is, the number of rows and columns), but because Graphical development tools cannot know your special requirements, so they can only take general requirements and define the width and height of each cell, thus adding a lot of code. Therefore, a wise web page writer should further learn the HTML language on the basis of mastering graphical editing tools, so as to know what is junk code. In this way, we can use graphical HTML development tools to quickly create web pages and eliminate useless code. code, so as to achieve the purpose of quickly producing high-quality web pages.

2. How to use HTML?

HTML language, also known as Hyper Text Markup Language, is the abbreviation of English Hyper Text Markup Language. As a markup language, HTML language is composed of some specific symbols and syntax, so it is very easy to understand and master. It can be said that the HTML language is the easiest to learn among all computer programming languages. The documents that make up HTML are all ASCII files, so creating HTML files is very simple and only requires an ordinary character editor. For example, Notepad and WordPad in Wndows can be used. You can also use dedicated HTML editing tools: tools such as CoffeeHTML, Homesite, HTMLedit Pro, etc. Their feature is that they can automatically check grammatical errors in HTML documents and assist in corrections. Thanks to the graphical HTML development tool, it is easier for us. We can use it to create a web page first, and then delete the useless code in the HTML code editor it comes with, using its WYSIWYG feature. This allows us to quickly master HTML proficiently. Especially Dreamweaver4, recently released by Micromedia, can put the source code editor and web page editor in the same window, which is really convenient.

3. Basic concepts of HTML

1. Tags

The symbols used by HTML to describe functions are called "tags". Such as "HTML", "BODY", "TABLE", etc. Marks must be enclosed in square brackets "" when used, and appear in pairs. A mark without a slash indicates the start of the mark's effect, and a mark with a slash indicates the end of the mark's effect. For example,

indicates the beginning of a table, and indicates the end of a table. In HTML, the size of the markup has the same purpose, such as and both indicating the beginning of a table.


Tags can contain tags, such as tables containing tables or other tags. The following HTML code structure is correct:


Novices learn old knowledge (1) HTML language basics


But tags cannot be cross-nested. The following code is wrong:


This is incorrect code


2. Special characters

Since square brackets and English double quotes are Used to prompt HTML tags and parameter values. If square brackets and English quotation marks are to be displayed on a web page, they can only be replaced by other symbols. The following are normal characters represented by common special characters:

>or>corresponding characters>
"or"——corresponding characters"
à——corresponding characters A

3. Syntax

A mark, in order to clarify its function, is often described with some attribute parameters. The definition of these attribute parameters is the so-called grammar. For example: paragraph mark

, its syntax format is:


This means that the

tag has two attribute parameters, namely "align" and "class", among which "align" is used It depends on whether the position of the definition section is on the left, on the right or in the center. The default value is on the left. In actual application, there can be no "align" and "class" parameters. Display, this is very important, this is one of our main criteria for judging useless code. If there is a statement code describing the default value setting in the web page code, it is obviously useless code. In addition, when setting the attribute value of the tag. , if the default value does not affect the effect or has little impact, we will try to use the default value, so that there is no need to set it, thereby reducing the code

.

The specific values ​​of the marker parameters must be added with Spanish quotation marks. For example: to center the paragraph content, the correct writing method is as follows:


Example of centering the paragraph content


The key to learning how to use HTML language well is to flexibly apply markup parameters. Especially the application of default values.

The above is the content for novices to learn old knowledge (1) HTML language basics. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn