Web front-end---HTML language form (day003)

Form

<form>Label: Form

There are many components that can be input or selected in the web form. The user can fill in the information in the form, and finally submit the form, and the client data can be submitted to the server. Action is the address of the submitted server and method is the submission method, including post and get. Post method is used here<form action="网页链接地址" method="post">内容<form/>

The text part of the form

Labels needed:

<label for="name值">内容</label> , The function of this label is to jump to the text box corresponding to the name value when clicking on the content.

<input type="类型" id="userid" name="username" value="本标签的默认值" size="20" readonly="readonly" placeholder="请输入" disable="disable"/>Where type is the type, generally text (single-line text box), id is the id of the label, name and value are the information submitted to the server, name is repeatable, and value is the value. size is the size of the text box. <readonly="readonly">Is to make the text box read-only. <placeholder="请输入">It is the prompt message when there is no input. <disable="disable">If the text box is disabled, the content becomes gray and unavailable.

Basic input syntax

1. Password box <input type="password" value="123456" sizr="number"/>When the type is password, the single-line text box input will be displayed in the form of black dots. Value is the initial password, and size is the width of the password area.

2. Single <input type="radio" value="男" checked="checked"/>selection box When the type is radio, it is a single selection option. Value is the initial value, and the name must be the same. <checked="checked">It is the default option. The value must be filled in for single selection.

E.g:

<form>
				男:<input type="radio" value="男"checked="checked" name="1"/>
				女:<input type="radio" value="" name="1"/>
			</form>

A single selection is created.

3. Multi-select box <input type="checkbox" value="默认值" name="复选框框名"/>When the type is checkbox, a check box is created, the value is the default value, and the name must be the same. When the name is the same, it is a group to form a multiple choice.

			<form>
				游戏<input type="checkbox" value="游戏" name="hobit" id="game" />
				编程<input type="checkbox" value="编程" name="hobit" id="program" />
				学习<input type="checkbox" value="学习" name="hobit" id="study" />
			</form>

4. File selection box <input type="file" name="img"/ accept=".文件后缀名,.文件后缀名...">When type is file, create a file selection box. name is the name of the file selection box.

5. Drop-down box<select name="名"><option></option></select>

Create a drop-down box.

<form>
	<select>
		<option>请选择</option>
	</select>
</form>

6. Multi-line text field<textarea cols="number" rows=""></textarea>

Create a multi-line text field. cols is the column length and rows is the row length.

7. <input type="reset" name="按钮名称" value="按钮上显示的资=字">`When type is reset, create a reset button. Reset the contents of the form to default values.

8. <input type="submit" value="按钮上显示的内容">When the type is submit, create a submit button. value is the display content on the button

9. <input type="button" value="按钮">When the type is button, create a normal button, which can only be used by the click trigger event.

Inline frame

Inline frame

<iframe src="初始界面的地址" name="内联框架的名称。"width="宽度" height="高度" frameborder="内联框架的边框厚度。"></iframe>

Embed a web page in your page. src is the address of the initial display page, and name is the name of your embedded window. To use the embedded window to open the hyperlink available:<a href="网页地址"target="内联框架name值"></a>

Author's contact information:
qq945677662
vxa2482466921
If there is an error, please help me to correct it, let us communicate together

Guess you like

Origin blog.csdn.net/qq_23998145/article/details/109266564