HTML( Hyper Text Markup Language),超文本标记语言。HTML文件的后缀名一般是: .htm, .html。
表格:
<table>
表示一个表格,<tr>
表示表格的一行,<td>
表示表格一行中的一个单元格,<th>
和<td>
一样,只不过<th>
标签让内容居中并加粗,常用于表示表头的信息。
<table border="1" align="center" width="80%">
<tr>
<th>aa</th> <!-- <th>标签让内容居中并加粗,用于表示表头的信息 -->
<th>bb</th>
<th>cc</th>
</tr>
<tr>
<td align="center"><b>dd</b></td> <!-- 使用<td>标签达到和<th>标签同样的效果 -->
<td align="center"><b>ee</b></td>
<td align="center"><b>ff</b></td>
</tr>
</table>
超链接:
<a>
表示超链接。href属性表示点击超链接跳转到哪个地方。
<a href="http://www.baidu.com">这是一个链接</a>
表单:
<form>
即表示表单。表单里面可以存放以下类型的元素:
-
text
username: <input type="text" value="hello world">
value属性指示初始化值。
-
password
<input type="password">
-
checkbox
兴趣:学习<input type="checkbox">旅游<input type="checkbox">睡觉<input type="checkbox">
-
radio
性别:男<input type="radio" name="gender">女<input type="radio" name="gender">
- 注意:name属性值一定要相同,即代表单选框在同一个组里面。
-
select
学历:<select> <option>小学</option> <option>初中</option> <option>高中</option> <option>大学</option> </select>
-
textarea
评论:<textarea></textarea>
-
file
文件上传:<input type="file">
-
submit
<input type="submit" value="submit">
-
reset
-
<input type="reset" value="reset">
-
注意:reset是让页面回到最初的状态。
-
button
<input type="button" value="button" onclick="javascript:alert('hello world');">
点击button按钮弹出一个带有hello world内容的对话框。
图片:
<img>,src属性表示图片的路径。
<img src="https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/img/logo/bd_logo1_31bdc765.png">