HTML的基础知识

1.用户名登陆、注册界面设置
<form method="post" action="save.php">
<label for="username">用户名:</label>
<input type="text"  name="username" id="username" value="" />
<textarea cols="50" rows="10">在这里输入内容...</textarea>

<label>性别:</label>

<label>男</label>

<input type="radio" value="1"  name="gender" />

<label>女</label>

<input type="radio" value="2"  name="gender"  checked="checked"/>

表格标签:
method:数据传送的方式,一般查询服务时用get,向后台提交数据时用post,如注册等等。
action:浏览者输入的数据被传送到的地方,比如一个PHP页面(save.php)。
label:标签,显示的标签。
type:类型有很多种,text文本输入框,textarea多行文本输入框,radio单选,checkbox复选,submit按钮具有提交作用,reset重置。
value:提交数据到服务器的值(后台程序PHP使用)。
name:为控件命名,以备后台程序 ASP、PHP 使用。
checked:当设置 checked="checked" 时,该选项被默认选中。
2.调查问卷的选择界面设置
1.下拉列表框
<form action="save.php" method="post" >

 <label>爱好:</label>

<select>

<option value="看书">看书</option>

<option value="旅游" selected="selected">旅游</option>
</select></form>
注:
value:是指向服务器提交的值,中间的是显示的值。
2.下拉多选
<form action="save.php" method="post" >
<label>爱好:</label>
<select multiple="multiple">
<option value="看书">看书</option>
      <option value="旅游">旅游</option>
      <option value="运动">运动</option>
      <option value="购物">购物</option>
    </select>
</form>

猜你喜欢

转载自blog.csdn.net/weixin_41626938/article/details/80394471