学习内容:
html、元素、属性和定位工具学习时间:
2021.11.21学习记录:
1、什么是HTML?
- HTML是用来描述网页的一种语言
- HTML指的是超文本标记语言(Hyper Text Markup Language)
- 标记语言是一套标记标签(markup tag)
- HTML使用标记标签来描述网页
2、HTML标签
- HTML标记标签通常被称为HTML标签(HTML tag)
- HTML标签是由尖括号包围的关键词,比如
<html>
- HTML标签通常是成对出现的,比如
<html>
和</html>
- 标签对中的第一个标签是开始标签,第二个标签是结束标签
- 空标签:没有结束标签,直接在开始标签中结束(eg:input标签)
- HTML标签是由尖括号包围的关键词,比如
3、HTML元素
- 元素 = 标签 + 属性 + 元素文本内容
- 例如:
<a href="http:/`在这里插入代码片`/www.baidu.com">点击我,百度一下</a>
- 标签
- 属性:为html元素提供各种附加信息的就是属性(id,name,class,…)
- 元素文本内容:显示在页面上的内容
4、HTML结构
- 一个html是由无数的元素嵌套而成。
- 一个html肯定会有head和body两部分,即头和主体部分。
- head中定义js,css;
- body中定义页面显示的主体内容。
5、常见需要掌握的HTML元素
- 文本输入框:
<input type = "text" value = "第一个输入框"/>`
- 选择框:
<input type = "checkbox"/>`
- 单选/复选按钮:
<input type = "radio"/>`
- 按钮:
<input type = "button"/>`
- 文件上传:
<input type = "file"/>`
- 密码输入框:
<input type = "password"/>`
- 下拉框:
<select><option></option></select>
- 超链接:
<a href="http://www.baidu.com">...</a>
- 表格:
<form>
<table>
<tr><tb></tb><tb></tb><tb></tb></tr>
<tr><tb></tb><tb></tb><tb></tb></tr>
<tr><tb></tb><tb></tb><tb></tb></tr>
</table>
</form>
- 图片:
<!--设置图片大小,单位是px-->
<img src="" width="" height="">
- 有序列表:
<ol>
<li>1</li>
<li>2</li>
<li>3</li>
</ol>
- 无序列表:
<ul>
<li></li>
<li></li>
<li></li>
</ul>
- 文本域:
<textarea rows=""></textarea>