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%". |
>>: The problem of being unable to enter the management page when installing rabbitmq in docker
Before talking about OO, design patterns, and the ...
HTML form tag tutorial, this section mainly expla...
Generally speaking, it is unlikely that you will ...
Layout part: <div id="slider"> &l...
[LeetCode] 177.Nth Highest Salary Write a SQL que...
HTTP Header Explanation 1. Accept: Tells the web s...
Brief description Suitable for readers: Mobile de...
I wrote a jsp page today. I tried to adjust <di...
MySQL itself does not support recursive syntax, b...
For a newly created website, take ASP.NET MVC5 as...
Install PostgreSQL 11 on CentOS 7 PostgreSQL: The...
Table of contents Preface 1. EndPoint 2. Connecti...
The main contents of this article are as follows:...
It is very easy to delete a table in MySQL, but y...
This article shares the specific code for JavaScr...