This article brings you to the content of the HTML table Form related knowledge Explanation (code example), there is a certain reference value, the need for friends can refer to, I hope to help you.
Open a link in a new browser window
<a> tags By default, the linked pages are opened in the current browser window, and sometimes we need to open them in a new browser window .
<a href= "Destination url" target= "_blank" > new browser window open </a>
mailto
<a> tags also have a role to connect to email addresses, using mailto to make it easy for visitors to send e-mails to website managers .
mailto email address, the browser automatically calls the default client e-mail program (such as Outlock) and automatically fills in the recipient's address in the Recipients box.
cc= cc address, after the recipient address with cc= address, you can fill in the CC address.
bcc= bcc address, use bcc= address after recipient address, can fill in Bcc address
multiple recipients, CC, BCC, separate multiple recipient addresses with semicolons, and can be sent to multiple recipient functions
subject= Message subject, add message subject with subject=
body message content, add the contents of the message with body=
If there are multiple arguments behind the mailto, the first parameter must be "?" At the beginning, each of the following parameters is separated by "&".
<a href= "mailto:123456@qq.com" > Send </a><a href= "mailto:123456@qq.com?cc=123456@qq.com" > Send </a ><a href= "mainto:123456@qq.com?bcc=654321@qq.com" > Send </a><a href= "mailto:123456@qq.com;654321@ Qq.com "> Send </a><a href=" mailto:123456@qq.com?subject= send e-mail "> Send </a><a href=" mailto:123456 @qq. com?body= Welcome to the world of HTML code > send </a>
Form
Use an HTML form (form) to interact with the user. The form can transfer the data entered by the browser to the server side so that the server-side program can handle the data that the table only son over.
<form>:<form> label is paired up,<form> start,</form> end
Action: Where the data entered by the browser is transferred to
method: How data is transmitted (Get/post)
Note: All form controls (text boxes, text fields, buttons, radio boxes, check boxes, and so on) must be placed between the <form></form> labels (otherwise the information entered by the user can not be submitted to the server)
<form method= "Delivery Method" action= "Server file" ><form method= "post" action= "save.php" > <label for = "username" > Username:</label> <input type = "text" name= "username"/> <input for = "Pass" > Password: </label > <input type = "Password" name= "pass" >
Label label on Form form
The role of the label tag is to improve usability for the user of the mouse. This control is triggered if the text is clicked within the label tag. That is, when the user clicks the label label, the browser automatically shifts the focus to the label-related form control (which is automatically selected on the form control associated with the label label).
Note: The value in the for property of the label should be the same as the value of the control's ID property.
<label for= "Control ID Name" >
Text input box, password entry box
A text input box is used when the user wants to type something like letters, numbers, and so on in the form . The text box can also be converted into a Password entry box.
type: When type= "text", the input box is a text input box; when type= "password", the input box is the password input box.
name: Name the text box for the background program ASP, PHP use
value: Sets the default value for the text input box. (usually play a cue)
<form> Name: <input type = "text" name= "MyName" > <br/> Password: <input type = " Password "name=" pass "></form>
Text field
Text input fields are required when users need to enter large pieces of text in the form .
<textarea> tags are paired with the appearance of,<textarea> beginning,</textarea> end;
cols: Number of columns in a multiline input field;
rows: Number of lines for multiple rows of input fields;
You can enter a default value between the <textarea></textarea> tags. Note that the two properties of cols and rows can be replaced by the width and height of the CSS style: Col uses the width, row, and height instead.
<form method = "Post" action= "save.php" > <label> Contact us </label> <textarea cols= "rows=" "> here to enter the content ... </textarea></form>
Radio box, check box
In HTML, there are two selection boxes, a single box and a check box , the difference is that the option in the Radio box allows the user to select only one item, and the user can select multiple or even full selections in the check box.
type: When Type= "Radio" is a radio box, type= checkbox when "checkbox"
Value: Submit data to server values
name: Name the control
checked: This option is selected by default when checked= "checked" is set
Note: The same group of radio buttons, name values must be consistent, so that the same group of radio buttons can be used as a single radio.
Drop-down list box
<option value= ' submit value ' > Options </option>
Drop-down lists are often used in Web pages, which can effectively save web space. It can be both single-choice and multi-select.
value= ' commit values '--values submitted to the server, options --Display values
selected= the "selected" property, the option is selected by default.
The drop-down list can be multi-select, set the Multiple= "multiple" property in the <selected> tab, you can implement multi-select function, under the window operating system, when you press CTRL when multiple selection, click ( You can select multiple options by using command+ click Under Mac.
Submit button and reset button
There are two types of buttons available in the form, the Submit button, and the Reset button.
Submit Button :
type: The button has a commit function only if the type value is set to submit
value: The text displayed on the button
Reset button :
type: The button has a reset function only if the type value is set to reset
value: The text displayed on the button
<input type= "Submit" value= "commit" ><input type= "reset" value= "reset" >