HTML is a standard language for making web pages. Learning to use HTML can quickly create beautiful web pages. This article will introduce the basic syntax of HTML and the steps for making web pages.
1. Basic syntax of HTML
HTML is a markup language that can use tags to describe the structure and content of a document. A complete HTML web page includes a head. There are two parts: the head and the body. The properties and metadata of the web page are defined in the head, and the content and style of the web page are added in the body.
The basic structure of a typical HTML web page is as follows:
Among them:
is an HTML5 document Type declaration tells the browser that this is an HTML5 web page;
is the root element of the HTML document and contains the content of the entire web page;
Contains some metadata of the web page, such as title (web page title), meta (web page description and keywords), link (style sheet), etc.;
contains the main content of the web page, including text, pictures, links, etc.
我的网页 欢迎来到我的网站
这是我的第一个网页
去百度一下
represents a paragraph, ![]()
represents a picture,
represents a link.
First, we create a file named style.css, introduce the file in the head tag of the HTML file, the code is as follows:
Then, add some in the style.css file Style, for example:
body { font-family: Arial, sans-serif; background-color: #f5f5f5; } h1 { color: #444; font-size: 36px; text-align: center; } p { color: #666; font-size: 16px; line-height: 1.5; margin: 20px 0; } img { max-width: 100%; height: auto; display: block; margin: 0 auto; } a { color: #0074D9; text-decoration: none; }
where:
If it doesn’t look good, you can continue to adjust and improve the CSS style.
3. Summary
The above are the basic steps for making HTML web pages. By learning and mastering the basic syntax of HTML and CSS, and using a good editor, we can quickly create beautiful web pages. . Of course, making web pages requires constant experimentation and learning. I hope this article can be helpful to beginners.
The above is the detailed content of How to make html web page. For more information, please follow other related articles on the PHP Chinese website!