HTML标签

 

<div>这是div</div>     

 块级标签,无论自己又多大,都占满整行,也叫伪白板标签  

 

<span>这是span</span>  

行内标签,自己有多大就占多大,也叫白板标签

   

<input type="text" placeholder="请输入用户名" value="请输入用户名">

type="text" :输入框

placeholder:沉底文字(鼠标点击会清除)

value:沉底文字(鼠标点击不会清除)

 

<input type="password" placeholder="请输入用户名" >

 type="password":输入的内容是密文

 

<input type="button" value="登录" onclick="alert(111)">

 type="button":按钮,如果想与后台交互需要手动绑定事件onclick

 

<input type="submit" value="注册">

type="submit":提交按钮,与后台有交互

 

<span>男</span><input type="radio" name="sex" checked="checked">
<span>女</span><input type="radio" name="sex">

type="radio:单选框 并需要与后面的参数配合使用

checked="checked":默认选中

 

<span>篮球</span><input type="checkbox" checked="checked">
<span>足球</span><input type="checkbox">

type="checkbox":多选框

checked="checked":默认选中

 

<input type="file">

type="file":选择文件

 

<input type="reset">

type="reset":重置,必须跟form表单连用

 

<label for="user">用户名</label><input type="text" id="user">

label:点击用户名就会将鼠标光标定位到输入框

 

<select name="xxxx" id="">
<option value="1">篮球</option>
<option value="2">足球</option>
<option value="3" selected="selected">乒乓球</option>
</select>

select:下拉框

selected="selected":默认选中

 

<a href="http://baidu.com" target="_blank">jump</a>

a标签

target="_blank":新打开一个页面

 

 <textarea name="" id="" cols="30" rows="10">多行文本</textarea>

textarea:多行文本

 

input标签都有name属性,可以与后台交互,name对应key

 

 

 

 

posted @ 2019-12-02 22:27  面包树下的路人  阅读(123)  评论(0编辑  收藏  举报