Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the HTML tags and basic elements

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article will explain in detail what are the HTML tags and basic elements. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

Elements and tags in 1.HTML

An element is an inclusion range defined by a single tag or a pair of tags. A tag is a string with a less than sign () on the left and right. The opening tag refers to a tag that does not begin with a slash (/) and contains a string of allowed attribute-value pairs. The closing tag is a tag that begins with a slash (/). Such as:

Connect

Four forms of 2.HTML element

Empty element

An empty element with attributes

Element connection with content

Element connections with content and attributes

Sum up the examples

The code is as follows:

/ / start symbol. You can parse if you don't have a browser.

/ / start document header

My name is cauthystop / title of the start document

/ / end the title of the document

/ / end the header of the document

/ / start document style

What is displayed by Hello Worldhands / browsers

/ / end the document body

/ / end the HTML document

Note: in HTML, attributes are independent of the case of the tag. Attribute values can be in double quotation marks or not.

3. Tags related to paragraph control

Represents paragraph, the purpose of which is to create a segment. The attribute align represents the alignment of the segment, which can be leftright justify

Indicates the role of linebreak: line break

Indicates the horizontal rule function: inserts a horizontal line, and the attribute represents the color either in read green or hexadecimal number, such as # ffoooo

The code is as follows:

Meditate at night

Meditate at night

There is a bright moonlight in front of the bed, like a cold frost on the ground.

Looking up, I find the moon bright; Bowing, in homesickness I'm drowned.

/ / effect drawing

4. Tags related to text display

... : Center the text

... : used to indicate the title of the document. N is an integer from 1 to 6, 1 represents the largest title, and the attribute align indicates the alignment of the title, which can be center,left right

... : used to set the font, size represents the font size, n can be an integer from 1 to 7, the larger the number, the larger the word displayed.

... Set the text to bold

... : set text to italic

The code is as follows:

Meditate at night

Meditate at night

Li Bai

There is a bright moonlight in front of the bed, like a cold frost on the ground.

Looking up, I find the moon bright; Bowing, in homesickness I'm drowned.

5. How to enter special characters

In HTML documents, such as uninterrupted spaces, carriage returns and other symbols, reserved words in HTML, some characters that do not exist in the keyboard, need to be referenced in order to enter, there are two reference types in HTML: character references and entity references.

Both character references and entity references begin with an & and end with a semicolon (;). If you are using a character reference, you need to add a # after &, followed by the decimal or hexadecimal code of the desired character (the encoding of the characters in the ISO 10646 character set). If you are using an entity reference, write a mnemonic of the character after &.

In HTML, spaces can be entered with full-width spaces.

Comments in 6.HTML

7. Class table-create a list of numeric numbers

Use the and tags to create numbered lists. You can use the type attribute to specify the type of numbering system, A (A _ Magi B ~ C), a (a ~ b ~ ~ C), I (III III), I (iii iii) 1 (1 ~ ~ 2 ~ 3) default.

Use the start attribute in the tag to set the starting sequence number.

Use the value attribute in the tag to change the numbering order within the list.

Use the and tags to create bulleted lists. The type attribute in Ul can be disc (solid circle) square (solid square) circle (hollow circle)

Use and tags to create unsigned lists, and label substitutions to create indented lists.

Use both and tags in the element to create a list of terms. The list item in the term list consists of two parts, the term and its description. The term is specified by the label and the description is specified by the label.

The code is as follows:

Mathematics

Language

Physics

Mathematics

Language

Physics

Mathematics

Language

Physics

Chemistry

8. Form

The form is made with... Where border is the width of the table, the default is 0, that is, the width of the table is not displayed.

... : used to define the title of the table

... The attribute align specifies how to align this line horizontally, you can specify the vertical alignment for leftcenter right. Valign, and you can top,middle,bottom

... : used to set the header

... : used to define cells

The code is as follows:

Form

Examination results

Language

Mathematics

English

eighty

seventy

sixty

sixty

seventy

eighty

9. The creation of the form

The property method specifies the HTTP method to use when sending data to the server, which can be the get or post method. Get is the default method. When the form is submitted using the get method, the submitted data is appended to the end of the URL (specified in the attribute action) and sent to the server as part of the URL. For example, we set action to reg.asp, and when the form is submitted, in the browser's address, we will see that http://localhost:8080/reg.asp?user=zhangsan&pwd=1234

The Post method sends the information in the menu to the server as a data block. No matter which method is used, the data is encoded in the same format: name1=value1&name2=value2

The property action specifies the address of the script that processes the form, that is, after the form is submitted to the server, who will handle it? specify the handler's URL in action.

Where type specifies the type of control to create The property name is used to specify the name of the control, and the server-side script that processes the form can get the form data represented by the name-value pair, and the corresponding value can be extracted using the name. The Name property is not displayed in the form, and the property size is used to determine the initial width of the controls in the form. The property value sets the initial value of the control.

Single-line text input control (type= "text") submit button (type= "submit")

Reset button (type= "rest") password entry control (type= "password")

Radio button (type= "radio") check box (type= "checkbox") Hidden Control (type= "hidden")

Create multiple lines of text input.

The following example uses a table to control a form

The code is as follows:

Form

User name:

Password:

Interest

Football

Basketball

Gender

Male

Female

Personal profile:

Personal profile

10. Hyperlink

The code is as follows:

... Linked text

Current directory

The directory above the current directory

Absolute path

World wide Web address

11. Embedded image

The code is as follows:

This is the end of this article on "what are the HTML tags and basic elements". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report