Home >Backend Development >PHP Tutorial >PHP basic study notes (1)
What is a form? - A form is not a table.
Some html elements where users can provide certain data or information or options. The form usually has a "submit" button, which can then provide this data/information/options to a program on the server for use - data processing.
—The core of the form is data.
The composition and form of form tags:
What are the form items?
Single-line text box:
Other attributes:
value: Set the initial text
size: Set the width of its input box (unit is "character width") - this number of characters can be placed in it
maxlength: Set the maximum number of characters that can be entered in this input box
readonly: This is a "no value" attribute, which means "read only". The writing method is: readonly="readonly"
disable: Set the input box to "invalid", that is, the data is invalid.
Password box:
Other attributes:
value: Set the initial text
size: Set the width of its input box (unit is "character width") - this number of characters can be placed in it
maxlength: Set the maximum number of characters that can be entered in this input box
Single option:
to
Other attributes:possible. It is also a "valueless attribute"
说 NAME special description: The single -option of a group requires that the name value must be the same.
Multiple options:
通 Explanation: Multi -options usually must have a value value;Other attributes:
possible. It is also a "valueless attribute"
Submit button:
交 Explanation: Click the submission button, then the form will be "submitted", that is, the data will be transmitted into the file set by the form of the form.
Image button:
The function of the picture button is actually "submit", but the displayed effect is a picture - this is helpful to beautify the page.
Reset button:
单 Explanation: The data that will be filled in or selected by all users of the form to the initial stateOrdinary button:
没有 Explanation: There is no effect on the form, but "action" can be generated from it to achieve other requirements (JS program)& File domain: & lt; input type = "file" name = "n9" /& gt;
选择 Explanation: allow users to choose local files (and send to the server) -the files are also data.Hidden field:
explained: not visible on the interface, but submitted to the server as a "hidden data" - required for programming.
E Pulling selection: Use Select and Option tag cooperation. But treat this as "a form item"
~ ~ ~
with
The selected attribute can be used on the option tag to indicate the default selected item of the select element (the first item is selected by default).
The multiple attribute can be used on the select tag, so that the select element can "select multiple" (that is, only one can be selected by default)
Multi-line options (also called list options): Multi-line options are actually just a "deformation" of drop-down selection - setting their size value to be greater than or equal to will result in multiple lines.
~ ~
Multi-line text box:
with 的 The number of rows set by ROWS is a number, indicating that the number of texts that can be displayed by the multi -line text box
的 The number of columns set by COLS is a number, indicating that the number of texts that can be displayed by the multi -line text boxThis tag has no value attribute. But its actual "value" is whatever is placed in the middle of this tag.
out out to be stored in the form – all form items must have a name attribute to indicate their "name" - the server retrieves the data based on this name.
Frame Tag
The first concept: We always only display one web page in an open "window".
But:
个 In fact, we can also open multiple web pages in one window -in fact, its essence is still a window to display a web page, but we will use some specific tags to divide a "large window" into several "small windows. ".
First of all, let’s be clear:
1. When using frame tag (frameset), you cannot use body tag - that is, use frameset tag instead of body tag
2. To use the frameset tag, you must use the frameset document type
The specific segmentation code is as follows:
F & lt; Frameset Cols = "Set the current window divided by column" rows = "to set the current window according to the line" & gt;~ ~
. . . . . . . . . . . . .
The value of cols is a continuous number or percentage representing the width of the column, separated by (,), where the "*" sign represents the width of the "rest". For example:
”Cols =" 100,800 ": indicates that the large window is divided into two small windows according to the column, the first is 100 width, and the second is 800 wide’ s to ’ s ’ s 1 t t through ’ ’ s ’ ’ s 1’s 1 100 t-t t t- s s s to be split into 3 small windows according to columns, the first one is 100 wide, the second one is 200 wide, and the rest is given to the third one
cols=”15%, *”
值 The value of ROWS is the number or percentage of the width of the continuous exponential line, which is separated from each other (,), where the "*" indicates the width of the "rest". For example:rows=”100,200,*”
row=”20%, *”
css introduction
CSS: Cascading Style Sheet
CSS allows us to control the appearance of the webpage from the following two aspects:
1. Control the appearance of web pages in batches, allowing us to save labor.
2. Precisely control the appearance of web pages: down to the pixel level.
Basic syntax form of css:
Selector { css attribute name 1: value 1; css attribute name 2: value 2; ………… }
Example:
font{color:red; font-weight:bold; font-size:18px;}
dt{
font-size:14px;
font-weight:bold;
🌜}
A way to differentiate between two attributes
html attribute: written in the tag, in the form: attribute name = "attribute value" - this quotation mark can be omitted, but it is recommended not to omit it for wall cracks
签 -also called "label attribute"—HTML attributes are usually “the own attributes of each tag, which are generally different”
——There are very few tags using the same html attribute
css attribute: written in curly brackets of the selector, in the form: attribute name: attribute value - pay special attention, the value cannot be enclosed in quotes
—can also be called “style attribute”
—CSS properties are usually “available to all tags”, generally the same
——There are very few tags that do not use the same css attributes
Selector Classification
Tag selector:
Format: tag name { …….. }
(Meaning: Refers to the attribute settings in all the labels in the (corresponding) webpage.
Class Selector:
Form: .Class name { …… }
(Meaning: The value of the Class in the (corresponding) webpage is all labels of this type of name apply the attribute settings.Example:
~
ID Selector:
Format: #idname{…… The meaning of (: The value of the ID in the (corresponding) webpage is that the label that names the name is set to the attribute settings.
个 Note: Generally, the ID name in a web page should not be the same, because ID itself means "only".Example:
~
Universal Selector:
Form: *{ ….. } ——Universal selector has only this form (symbol)
Meaning: It automatically refers to "all tags", that is, all tags apply this attribute setting
器 Note: The general choice device is used with caution, which is usually used only to set up a few basic attributes, such as text color, text size, padding, marginPseudo class selector:
Form: :pseudo class name {……}
Note: There are actually only a few pseudo-class names stipulated within the system and not defined by ourselves, such as: link, visited, hover, active. Their meanings are also specific. Usually the above pseudo-classes are only used for a tags, and their form and meaning are usually:
a:visited{…..} :表示一个a链接标签在点击(访问)过之后的时候的状态(访问后状态)
a:hover{….} :表示一个a链接标签在鼠标放上去的时候的状态(悬停状态)
a:active{….} :表示一个a链接标签在鼠标摁住但还没有抬起的状态(活动状态)。
不过,最新的浏览器中,出于安全考虑,a的hover和visited效果有些属性不能用了。
复合选择器之:层级选择器
形式: 选择器1 选择器2 { ……… }
含义: 在选择器1所对应的标签中由选择器2所对应的那些标签。。。。。其中,选择器1和选择器2可以是前面所学的任意某种选择器,而且这种层级关系还可以多层次,比如:
#d1 div{…}
.cc1 p span{…..}
p .cc2 img{…..}
#d1 p a:hover{….}
举例:
div p{ color: red;}
段落1
Compound selector: group selector
Form: Selector 1, Selector 2 {………… }
Meaning: It means that both selectors use the same attribute settings. In fact, it is nothing more than a way of writing simplified code, otherwise they have to use two selectors to write.
.a {color:red; font-size:15px;}
.b{ color:red; font-size:15px;}
è
.a, .b{ color:red; font-size:15px;}
Other compound forms (examples):
div.cc1{…} : Represents a div tag with class value cc1, which is completely different from div .cc1{…}.
p
Frame:
Frame tags are a technique used to divide the "current window" into smaller windows. framseset replaces the body tag and uses the frame document type.