Basic structure of HTML base 1.1HTML file and introduction to the standard 1.1.1HTML
HTML is a language that describes a Web page, a Hypertext Markup Language!
Basic structure of the 1.1.2HTML file
Note that labels must appear in pairs
1.2 Basic labels for Web pages each label has a pair of angle brackets, omitted here
- Title label
H1 H2 H3 h4 h5 h6 (font style becomes smaller)
- Paragraph and line wrapping labels
P BR
- Horizontal line Label
HR: Indicates the ability to generate a horizontal line
- Font style labels
Strong: Can bold font
EM: can tilt the font
- Annotations and special symbols
Note:!--Content--
Special symbols:
- Space:
- Greater than sign:>
- Less than number: <
- Quotation marks: "
- Copyright symbol:?
1.3 Image Labels
Syntax:
1.4 Link Tags
List Table Frame 2.1 list
- Unordered list
An unordered list is an item list that uses bullets to mark an unordered list. There's no grade.
Unordered list consists of: UL and Li
- Ordered list
A list of lists, consisting of numbers or letters, when there is a sequence table
The sequence list consists of: ol and Li
- Definition List
A definition list is a combination of projects and annotations
Definition list consists of: DL DT DD
2.2 Table
- Why Use Tables
Simple and Universal
Structural stability
- Basic structure of the table
Cell: The smallest unit of a table
Row: One or more cells are stacked horizontally
Columns: vertical arrangement of cells
- Basic syntax for tables
- Table Tags: table
- Row labels (can have multiple lines): TR
- Column labels (can have multiple cells): TD
- Alignment of the table
- Horizontal direction
- Left-justified: align= "Ieft"
- Right alignment: align=
- Center alignment: align= "center"
- Vertical direction
- Top alignment: valign= "Top"
- Bottom alignment: valign= "Bottom"
- Center-aligned: valign= "Middle"
- Baseline end Alignment: valign= "Baseline"
2.3 Frame Form 3.1 form
- Label and properties of the form
Form label to implement the form input tag is a label for the auxiliary form to set various inputs
Property values for form:
- Action: Represents the address of the submission and, if empty, represents this page
- Method
- How the server sends data: Post/get
- Post: The data on the form is sent as a block of data and does not apply to the request character get: The browser creates a request that returns the specified script
form elements and formatting
- TextBox (Text)
Example: <input type= "text" name= "fname" >
- Password box (password)
Example: <input type= "password" name= "FName" >
- radio button (Redio)
Example: <input type= "Redio" >
- check box (checkbox)
Example: <input type= "Checkboc" >
- List box (selected option)
Example: <seleceted> <option value= "content" ></option> </selected>
- Button
- Submit button
Click. Content will be submitted
- Reset resets
Click this button to implement the reset
- Bottom Normal
- Multiline text fields
Syntax: <input type= "image" src= "images/login.jpg" >
- File fields
Implementing a File Selection
Syntax: <input type= "file" name= "Files" >
3.2 Advanced Applications for forms
- Set hidden fields for a form
When you set the value of type to hidden, you can hide the hidden file
- Read-only and disabled settings for the form
- Read-only scenario: The Web server does not want users to modify the data, which is displayed in the form elements. (Property set readonly= "ReadOnly")
- This feature can only be used if this condition is met. (disabled= "Disabled")
3.3 Semantically formatted forms
Semantic: To achieve simple structure, simple code.
Fieldest: This label implements the definition of a domain. When you place elements in this tag, the browser displays them in a special way, and the forms may have a boundary.
Legend: A label is a caption that is set for a field,
- These two tags are usually used together. Implement a semantic Word form
- Comments for form elements
- Definition: The content is annotated with a tag, and when the user clicks on it, the browser automatically focuses on the corresponding form element.
- Syntax: <label for= "id of form Element" > Annotated text </label>
- Note: You need to define the attribute in the input tag:ID and assign a value
The significance of using CSS in the initial knowledge of CSS4.1
Full name: Cascading style sheet, also known as style style sheet, it is used for web design, make the webpage beautiful, clear!!
- The application of CSS in the website
can set the font style, size, color, can make the image, text center, hyperlinks different effects, beautify the page
- Advantages of CSS
- Separation of content from performance. You can use CSS styles to monopolize a file (Maintenance-friendly)
- Consistent performance
- Has a rich style
- Reduce the amount of code on a webpage
- Use of independent CSS to facilitate search engine inclusion
Basic syntax for 4.2CSS
- Basic syntax structure of CSS
CSS consists of two parts, the selector and the declaration, which must be placed in curly braces, which can be multiple, each declaration consists of a property and a value, the attribute and value are separated by a colon, and the statement ends in English.
Syntax: selector {property: value;}
- Meet <style Tags >
A style tag is a label that introduces CSS styles. This tag is also assigned to the header property of this tag in the head tag: type= "Text/css"
- CSS Selector
- Tag Selector
- Class Selector
- When you want a paragraph to be another case, it's a good idea to introduce a class selector
- Syntax:. Class Name {property: value;}
- ID Selector
- When the page only needs to be used once, select the ID selector!
- Syntax: #id的名称 {property: value;}
4.3 Introducing CSS styles in HTML
- inline style
is to use the tags directly in the HTML
No implementation of content and performance separation, not reflected in CSS to get advantage (not recommended)
- Internal style
Write the CSS code directly in the head's style tag, with the HTML file in a file
- External styles
Create a separate file name for the CSS suffix, and then use it directly through the linked or imported
- Linking external style sheets
You must use the link tag in the HTML file to link
Syntax: <link href= "css/file name. css" rel= "stylesheet" type= "Text/css"/>
- Import external Styles
<style type= "Text/css" >
[email protected] URL ("Style.css");--
- Priority of Style
- Inline style > class style > External style
- ID selector > class selector > tag Selector
Advanced Applications for 4.4CSS
- CSS Composite Selector
- Descendant Selector
The descendant selector is the outer label written in front, the inner layer is written inside, separated by a space. When a tag is nested, the inner layer is the descendant of the outer.
Nesting by tags
Nesting by selectors
3 kinds of nesting with each other
- Intersection Selector
The intersection selector is made up of two selectors, with the result that the intersection of the two respective element ranges is selected. The first one must be a tag selector, and the second must be a class selector or an ID selector. Two cannot have space between, must write continuously
The selectors that make up this way will select the two defined elements that are met at the same time. This is the label selector defined by the former, and the type or ID element of the latter is established.
- and set Selector
Also select the range selected by each base selector. Selectors of any form can be used as part of the set selector.
A set selector is a comma-linked selection of selectors.
- CSS Inheritance Features
- The inherited relationship
All CSS is inherited by the individual tags. Can be called a parent-child relationship
- Inherited apps
CSS inheritance child tags will inherit the parent tag style, style, can be modified on the basis of the parent tag style style, create a new style, and the child tag does not affect the parent tag
CSS Beautify page elements 5.1 using CSS to edit Web page text
- The meaning of text in Web pages
- Effective delivery of page information
- Using CSS to beautify the page text, is the page beautiful and beautiful
- Can be very good to highlight the page theme
- Have a good user experience
- <span label >
To highlight text or statements, you have to use the span label <span></span>
- Style of the font font-family
Font-size
Font-style
Font-weight
Font setting type for fonts
Set the size of the font
Set the style of the font
Set the weight of a font
At the same time in a declaration
- Compose text using CSS Web pages
Color
Text-align
Text-indent
Line-height
Text-decoration
Set the color of text
Set element Horizontal Alignment
Set the first line of text indent
Set the line height of the text
Set the decoration of text
5.2 Using CSS to set up hyperlinks
Default
Pointer
Wait
Help
Text
Crosshair
Default cursor
Hyperlink pointer
Indicates that the program is busy
Indicates the available Help
Indicate text
Mouse appears in a cross-shaped
5.3 Style of the background
5.4 Style of the list
The sixth chapter: Box model 6.1 Box model
- 6.1.1 What is a box model
Div has a certain distance from the box, and these distances and div form the structure of the box model! Box models have properties: Padding, margins, borders
Frame: equivalent to the box carton, generally with a certain thickness!
padding: Inside the border, is the distance between the content and the border!
Margin: Outside the border, is the border with the surrounding gap
- 6.1.2 Margin
has three properties: color width style
Setting Method: Border-color:border-width:border-style:
General Unified Settings: Border:color (color) width (width) style (type/solid/dashed): Represents setting the color of four sides-type-width
If you want to set it separately: that is Border-top-color:border-top-width:border-top-style:
- 6.1.3 Outer margin
Definition: The distance between the other boxes. That is, the distance between elements and elements of a webpage.
Common methods are: Margin-top:z set the upper margin
Common methods are: Margin-right set the margin
Common methods are: Margin-left: Set the left margin
Common methods are: Margin-right: Set the right margin
Merge: margin:? px
Margin:? Px? px
- 6.1.4 Inner margin
Definition: The distance between the content and the border for precise control over the position of the content
Padding-top: Upper inner margin
Padding-bottom: Lower inner margin
Padding-left: Left inner margin
Padding-right: Right inner margin
- Dimensions of the 6.1.5 box model
Size of Box model: padding + margin + border Width + content width
6.2 Standard Document Flow
- Standard document Flow
Composition: Standard document Flow: block-level elements and inline elements!
Block-level elements: Each element is exclusive of a rectangular area, left and right, and adjacent elements will want to zeros direction.
Inline elements: content is arranged horizontally and does not monopolize a rectangular region. To the most end of the automatic line-wrapping!!
- Display Properties
Block |
The default is block-level elements with line break |
Inline |
Inline element: Default No Line break |
None |
Set element does not display |
Seventh: Floating 7.1 page layout
There are several types of Web page layouts: 3 most common
7.2 Floating
- Application of floating in Web pages
You can implement a global layout: You can lay out the navigation bar, content, and title. Use the Float Property!
- Float Property
Left |
Element floats to the left |
Right |
Element floats to the right |
None |
element does not float |
Example: Float:left
7.3 Clear Float
- Clear floating effect
Left |
Clear left Float |
Right |
Clear right float |
Both |
Clear left and right float |
- Extended Box Model
Add a div to the back of all div boxes
CSS over there set {Clear:both margin:0px padding:0px}
7.4 Overflow problem
- Overflow property
Resolve Content Overflow Processing
Visible |
Default value, content will not be trimmed and will be rendered outside the box |
Hidden |
Content is clipped and the rest is not visible |
Scroll |
Content will be added Roll Tojo, will be trimmed |
Auto |
scroll bar (auto) if trimmed |
- The magical properties of overflow
Extend the height of the box: The box will be opened.
Example: Overflow:hidden:
HTML Basic Knowledge Note