HTML Tags
Grammar:
Explain:
1 , SRC: identifies the location of the image;
2 , alt: specifies descriptive text for the image, and when the image is not visible (when the download is unsuccessful), you can see the text specified by the attribute;
3 , Title: provides a description of the image when the image is visible (the text displayed when the mouse slides over the picture);
4 . The image can be an image file in gif,png,jpeg format.
HTML form labels, user interaction
Grammar:
<form method= "transfer mode" action= "Server file" >
Explain:
1.<form>:<form> tag is in pairs, to <form> start, to </form> end.
2.Action : where the data entered by the browser is transmitted, such as a PHP page (save.php).
3.method : The way data is transmitted (Get/post).
<form method= "POST" action= "save.php"> <label for= "username" > User name: </label > <input type= "text" name= "username"/> <label for= "pass" > Password:</label> <input type= "Password" name= "pass"/></form>
Attention:
1. All form controls (text boxes, text fields, buttons, radio boxes, checkboxes, and so on) must be placed between the <form></form> tags (otherwise the user input information can not be submitted to the server Oh!). )。
2, Method:post/get the difference this part of the content belongs to the back-end programmer to consider the problem.
HTML text input box, password input box
Syntax :
<form> <input type= "Text/password" name= "name" value= "text"/></form>
1
、type:
当type="text"时,输入框为文本
Input box;
当type="password"时,
输入框为密码输入框。
2
、name:
为文本框命名,以备后台程序ASP 、PHP使用。
3
、value:
为文本输入框设置默认值。(一般起到提示作用)
HTML文本域、支持多行文本输入
语法:
<textarea
rows="
行数"
cols="
列数"
>
文本</textarea>
1
、<textarea>标签是成对出现的,以<textarea>开始,以</textarea>结束。
2
、cols :
多行输入域的列数。
3
、rows :
多行输入域的行数。
4
、在<textarea></textarea>标签之间可以输入默认值。
举例
:
<form method="post" action="save.php"> <label>
联系我们</label>
<textarea cols="50" rows="10" >
在这里输入内容...
</textarea>
</form>
HTML单选框、复选框
语法:
<input type="radio/checkbox" value="值" name="名称" checked="checked"/>
1、type:
当 type="radio" 时,控件为单选框
当 type="checkbox" 时,控件为复选框
2、value:提交数据到服务器的值(后台程序PHP使用)
3、name:为控件命名,以备后台程序 ASP、PHP 使用
4、checked:当设置 checked="checked" 时,该选项被默认选中。
注意:同一组的单选按钮,name 取值一定要一致,这样同一组的单选按钮才可以起到单选的作用。
HTML Basics Note (ii)