html常用标签
标签中间展示的是文案
<body>
<h1 align="center">第一个标题</h1>
<h3>
<a href="#h4">h3标签点击跳转到h4</a>
<a href="http://www.baidu.com">跳转百度当前页面</a>
<a href="http://www.baidu.com" target="_blank">跳转百度新开页面</a>
</h3>
<p><q>第一个段落</q></p>
<h4 id="h4">这是h4标题</h4>
<img src="https://dn-simplecloud.shiyanlou.com/course/1542592801417_%E3%80%90596%E3%80%91-%E3%80%90Python3%E7%AE%80%E6%98%8E%E6%95%99%E7%A8%8B%E3%80%91.png"
width="400px"
height="200px">
</body>
h1-h5是标题标签,几级标题
p是段落的标签
a是链接的标签
链接是别的元素的,点击直接跳转到对应元素;链接是链接的点击跳转对应链接
img是图片的标签
src是图片的链接地址
q 是引号标签
table标签–表格
每个表格均有若干行(由 标签定义)
每行被分割为若干单元格(由 标签定义) td =>table data
表格的表头用th 标签定义 table header
-下面其中,border=1是指表格的边框
<table border="1">
<header>
<tr>
<th>表头1</th>
<th>表头2</th>
<th>表头3</th>
</tr>
</header>
<tr>
<td>1-1</td>
<td>1-2</td>
<td>1-3</td>
</tr>
<tr>
<td>2-1</td>
<td>2-2</td>
<td>2-3</td>
</tr>
</table>
运行的样式是:
input输入框
< input type=“text”>定义用于文本输入的单行输入字段,value是输入框的值,placeholder是输入框没有值的时候的灰色底词提示
<input type="text" name="" value="Mac-note" placeholder="请输入用户名">
< input type=“radio” > 定义单选按钮。
< input type=“checkbox” > 定义多选框,可复选。
< input type=“submit”>和button定义用于按钮,点击submit会跳转到form的目标页面
< input type=“reset” > 定义重置按钮,会重置整个form标签中的内容
< input type=“file” > 上传文件
<form action="http://www.baidu.com">
<div>
男<input type="radio" value="1" name="sex" checked="checked">
女<input type="radio" value="2" name="sex">
</div>
<div>
米饭<input type="checkbox" value="1" name="sex" checked="checked">
面条<input type="checkbox" value="1" name="sex">
</div>
<div>
<input type="button" value="登录">
<input type="submit" value="注册"> //点击注册就跳转到form里链接的百度页面
</div>
<div>
<input type="reset">
<input type="file">
</div>
</form>
label的for属性
与id属性连用,增大input的可点击范围,用了之后,点击用户名文案也可以选中输入框
<div>
<label for="i1">用户名</label>
<input type="text" id="i1">
</div>
Textarea 是多文本输入框,定义了宽高
<textarea name="" id="" cols="30" rows="10"></textarea>
select 是下拉选择框,其中optgroup 是不可选的,还有下级备选内容的
<select name="city" id="">
<optgroup label="黑龙江">
<option value="3">哈尔滨</option>
<option value="4">牡丹江</option>
</optgroup>
<option value="1">北京</option>
<option value="2">上海</option>
</select>