Home >Web Front-end >HTML Tutorial >Powerful HTML_html/css_WEB-ITnose

Powerful HTML_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:44:533534browse

HTML basic tags (1)

1. What is HTML

html: Hyper TextMakeup language: Hypertext Markup Language

html: The "source code" of the web page

Browser: a tool to "interpret and execute" the html source code

2. Summary information of the web page

The summary information of the web page is conducive to browser analysis and search Engine search:

2.1 Use the tag </p> <p><head></p> <p><tlite>Sohu-China's largest portal

2.2 Use tags

(1) Describe document type and character encoding

(2) Describe search keywords and description

3. Blocks and lines in HTML pages

HTML tag classification (to facilitate subsequent layout design)

Block-level labels: Displayed in a "block" shape, separated by one line before and after

Row-level labels: Displayed one by one line by line

Emphasis: The difference between block-level and row-level labels:

Block level: line breaks before and after

Row level: displayed in one line

Block-level tags are divided into: basic block-level tags, block-level tags commonly used in layout

Basic Block-level tags:

001. Title tag

Title

...

< h6>Title

h1 is the largest, h6 is the smallest

002. Paragraph tags

...

003. Horizontal line tags


Block-level tags commonly used in layout:

001. Ordered list tags

  1. List item 1

002. Unordered list tags

  • List item 1

003. Define description tags (commonly used for mixing images and text) Editor)

Title

Description1

004. Use definition description tags to achieve the effect of mixed graphics and text

005. Table

< ;tr>

Baidu Sina

006. Form

...

007. Partition tag div

Key points: Generally used as structured block elements, as logical partitions (blocks) That is, containers are used.

04. Please tell me what are the 4 block structures commonly used in actual development?

01.div-ul(ol)-li: Commonly used for category navigation or menus, etc.

02.div-dl-dt-dd: Where commonly used words are mixed with images and text

03.table-tr-td is often used for image and text layout or data display

04.form-table-tr-td: Commonly used for layout forms

05. Row-level tags

001, image tags

Prompt text

For compatibility between browsers, it is recommended to use the title attribute to ensure that the prompt text can be displayed

alt: When the picture is not When displayed, the text displayed on the picture

title: The text displayed on the picture when the mouse is over

002. Row-level label : Displays the unique style in a certain line

Text and other line-level content

003. Line break tags

06. Why is w3c needed? Standards

w3c: World Wide Web Consortium, World Wide Web Consortium

W3C’s functions: Responsible for formulating and maintaining web industry standards

Web structure advocated by W3C:

1. Separation of content (structure) and presentation (style)

2. HTML content structure requires semantics

07.XHTML1.0 basic specification

001. Tag name and Attribute names must be lowercase

002.html tags must be closed

003. Attribute values ​​must be enclosed in quotes

004. Tags must be nested correctly

005. A document type declaration must be added

The document declaration must be at the front of the document. There are three levels: Strict (strict type), Transitional (transitional type), Frameset (frame type)

Basic HTML tags (2)

01. Hyperlink--implementing navigation between pages

Syntax: Link hot text or image

For example:

02. Relative Path: relative to the address of the current directory, commonly used

Login

Absolute path: pointing to the complete target address Description, use sparingly

Login

Sohu

Important: If you want to access the upper-level path of the current path, you can use ../

03.Super Three application scenarios of links

001. Links between pages

002. Anchor links

003. Functional links

001. Links between pages

[Login]

Applicable occasions: commonly used in website navigation

002. Implement anchors Links (divided into same-page anchor links and inter-page anchor links)

Same-page anchor links:

1. Define tag (anchor): Target position

2. Set the link to the mark position: Current position

Applicable occasions: Applicable When the page content is large and exceeds one screen

Cross-page link:

1. The page where the tag is located: [Celebrity Area]< /a>

Anchor links can be used on the same page or across pages

2. Set the link to the tag position: star Special area

003. Functional links

E-mail, QQ links, etc.

To be written...

04. Comments

The commented lines are used to increase the readability of the code and are not displayed

05. Special symbols

Space:

Greater than: >

Less than: <

Quotation marks ("): "

Copyright number (): ©

Because <, > and other symbols have been used in HTML, they must be replaced by other symbols, all ending with ;

06. Common form elements

Single-line text box (text)

Password box (password)

Text area (textarea)

Radio button(radio)

Checkbox(checkbox)

Submit button(submit)

Drop-down list(select)

< ;select>

Reset button (reset)

07. Basic syntax of the form

: There are only two submission methods: post and get

Text boxes, buttons and other form elements

action: Specify which handler on the server will handle it after submission

method : Specify the method to submit to the server: generally the post or get method, the post method is safer.

08. The execution principle of the form

Client: request login, fill in the account information through the form

The client and the server are like two people communicating, thus establishing interactive activities

Server side: Verify the account information sent and give feedback!

09. Basic format of form elements

10. Introduction of form elements one by one

Text box

name is used to obtain data on the server side, for example: request.getParameter("userName")

Password box

Button

Normal button: button

Submit button: submit

Reset ( Clear) button: reset

Image button: image

Radio button

The same name indicates that they belong to the same group

Features: Single selection

Checkbox

Features: Multiple selection

File field

Example:


Hidden field

It is convenient for the server to "remember" the client's information. Data that you don’t want customers to see

Read-only and disabled attributes

readonly: I hope that the content in a certain box can only be viewed by users and cannot be modified

disabled: Users are restricted from using it because the conditions for use are not met



Agree to the above agreement

< input name="btn" type="submit" value="Register" disabled="disabled"/>

Table application and layout

1. Why use sheet?

Common applications of forms:

01 Forum

02. Shopping website

03. Portal application form

2. The basic structure of the table

Rows, columns and cells

Features: Normally, the height of the same row is the same and the width of the same column is the same

3. Basic syntax of tables

Baidu

Sina
Google 56网

How to create a table?

represents the beginning of the table, border="2" indicates that the border width is 2

4. The table spans rows and columns (emphasis, emphasis!! ! )

How to span columns

< td colspan="3">Student performance

;/td>

Chinese

98
95

Among them, the colspan attribute indicates how many columns it spans

The content of other cells in the row is omitted

The rowspan attribute indicates how many rows it spans

5. Table advanced tags

Table title:

Header:

Header:

Data subject: layout?

Implementation steps:

01. Determine the number of rows and columns: 5 rows and 2 columns

02, write a table with 5 rows and 2 columns

03, determine the span of rows Cells spanning columns:

1 row and 1 column cells span 2 columns

2 rows and 1 column cells span 4 rows

04. Add rowspan and colspan to delete redundant ones Cell,

                                                                                                                                                                        Best selling online

……

Bulletin Board
Announcement left picture

7. How to implement form layout?

What are the requirements for displaying data using tables for layout? What is the implementation idea?

Usage occasions: The data display requirements are regular and consistent with the characteristics of table layout

Layout implementation ideas:

01. How many rows and columns of tables are needed?

02. Which cells span rows or columns?

03. Write table code to implement

Note: 1. The width of cells in the same column is determined by the cell with the largest width in the column

2. Same row The cell width is determined by the cell with the highest height in the row

8. Nested layout

Disadvantages of nested table layout:

01, The amount of code is large

02, and the hierarchical structure is relatively complex

03, which is not conducive to searching for data with search engines such as Google

9. Applicable occasions for table layout:

01, regular data display

02, form page

Tip: Table layout is not suitable for irregular and complex pages. In this case,

needs to use DIV CSS layout

Framework

1. Why use frames?

Two types of uses of frames:

01. Display multi-window pages--use frameset

02. Page reuse--use