HTML Basics: The basic structure of HTML

HTML Basics: The basic structure of HTML
The basic structure of HTML hypertext documents is divided into two parts: document header and document body. In the document header, some necessary definitions of the document are made, and the document body contains various document information to be displayed.
<HTML>
<HEAD>
Header information</HEAD>
<BODY>
Document body, text part</BODY>
</HTML>
Among them, <HTML> is at the outermost layer, indicating that the content between this pair of tags is an HTML document. We will also see some hompages omit the <HTML> tag because .html or .htm files are assumed to be HTML documents by web browsers. <HEAD> includes the document's header information, such as the document's overall title, etc. If no header information is needed, this tag can be omitted. The <BODY> tag is generally not omitted and indicates the beginning of the main content.
The following is the source code of a basic hypertext document: <HTML>
<HEAD>
<TITLE>A simple HTML example</TITLE>
</HEAD>
<BODY>
<CENTER>
<H3>Welcome to my homepage</H3>
<BR>
<HR>
<FONT SIZE=2>
This is my first time making a homepage. No matter what, I will try my best to do it well!
</FONT>
</CENTER>
</BODY>
</HTML>
━┓
┃File Header━┛
━┓



┃Document body┃



━┛
Tags in hypertext <br />When you first come into contact with hypertext, the biggest obstacle you encounter is the sentences enclosed in “<” and ">”. We call them tags, which are elements used to divide and mark text to form the layout of the text, the format of the text and colorful pictures.
1. Single tag Some tags are called "single tags" because they can fully express their meaning when used alone. The syntax of such tags is:
<Tag Name>
The most commonly used single tag is <BR>, which indicates a line break.
2. Double tag Another type of tag is called "double tag", which consists of two parts: "start tag" and "end tag" and must be used in pairs. The start tag tells the web browser to execute the function represented by the tag from here, and the end tag tells the web browser to end the function here. Adding a slash (/) before the start tag makes it an end tag. The syntax for this type of tag is:
<tag>content</tag>
The "content" part is what is acted upon by this pair of tags. For example, if you want to highlight a certain text, put it in an <EM> </EM> tag:
First:
3. Tag attributes Many single- and double-tag start tags can contain some attributes. The syntax is:
< Tag Name Attribute 1 Attribute 2 Attribute 3 … >
There is no order of precedence among the attributes, and the attributes can be omitted (that is, the default values ​​are taken). For example, the single tag <HR> means drawing a horizontal line at the current position of the document, generally from the leftmost end of the current line in the window to the rightmost end. With some attributes:
<HR SIZE=3 ALIGN=LEFT WIDTH="75%"> The SIZE attribute defines the thickness of the line. The attribute value is an integer, and 1 is missing. The ALIGN attribute represents the alignment, which can be LEFT (left alignment, default value), CENTER (center), or RIGHT (right alignment). The WIDTH attribute defines the length of the line, which can be a relative value (a percentage enclosed in a pair of " " signs, indicating the percentage relative to filling the entire window) or an absolute value (the number of screen pixels expressed as an integer, such as WIDTH=300). The default value is "100%".

<<:  MySQL 8.0.22 compressed package complete installation and configuration tutorial diagram (tested and effective)

>>:  The problem of being unable to enter the management page when installing rabbitmq in docker

Recommend

Copy and paste is the enemy of packaging

Before talking about OO, design patterns, and the ...

HTML form tag tutorial (3): input tag

HTML form tag tutorial, this section mainly expla...

Discussion on the numerical limit of the ol element in the html document

Generally speaking, it is unlikely that you will ...

SQL implementation of LeetCode (177. Nth highest salary)

[LeetCode] 177.Nth Highest Salary Write a SQL que...

HTTP header information interpretation and analysis (detailed summary)

HTTP Header Explanation 1. Accept: Tells the web s...

A collection of possible problems when migrating sqlite3 to mysql

Brief description Suitable for readers: Mobile de...

MySQL recursion problem

MySQL itself does not support recursive syntax, b...

Introduction to ApplicationHost.config (IIS storage configuration area file)

For a newly created website, take ASP.NET MVC5 as...

How to install PostgreSQL11 on CentOS7

Install PostgreSQL 11 on CentOS 7 PostgreSQL: The...

Tomcat source code analysis of Web requests and processing

Table of contents Preface 1. EndPoint 2. Connecti...

Bootstrap 3.0 study notes CSS related supplement

The main contents of this article are as follows:...

How to delete a MySQL table

It is very easy to delete a table in MySQL, but y...

Implementation of whack-a-mole game in JavaScript

This article shares the specific code for JavaScr...