文章目录
0 学习体系
1 HTML
Hyper Text Markup Language
1.1 基础
1.1.1 基本概念
1.1.2 小案例
变粗
Name: xhh
<strong>变粗的方式</strong>
1.1.3 网页框架
<html>
<head>
<title>
这里是标题
</title>
</head>
<body>
这里是内容
</body>
</html>
1.1.4 开发工具
vscode
1.1.4 语法规范
注释
<!-- 在vscode 注释快捷键: ctrl + / -->
标签的构成
标签属性
标签关系
1.2 基本标签
1.2.1 排版标签
标题
段落
换行
水平线
<!-- hx 1-6 标题 -->
<h1>标题1</h1>
<!-- 段落 -->
<p>段落内容</p>
<!-- 强制换行 -->
<p>段落<br>内容</p>
<!-- 水平分割线 -->
<hr>
1.2.2 文本格式化标签
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<b>加粗</b>
<u>下划线</u>
<i>倾斜</i>
<s>删除线</s>
<!-- 分割线 -->
<hr>
<strong>加粗</strong>
<ins>下划线</ins>
<em>倾斜</em>
<del>删除线</del>
</body>
</html>
1.2.3 媒体标签
图片标签
<!-- src:原路径 alt:加载失败显示 title:提示文本 -->
<img src="./xhhh.jpg" alt="load error" title="mcy">
<!-- 宽 高, 如果只设置一个 会进行等比例缩放 -->
<img src="./xhhh.jpg" alt="load error" title="mcy" width="100" height="100">
音频标签
视频标签
1.2.4 链接标签
<a href="https://www.nowcoder.com/">点击这里</a>
1.2.5 总结
1.2.6 综合案例
1.3 常用标签
1.3.1 列表标签
应用场景
无序列表
<h5>水果标签</h5>
<ul>
<li>苹果</li>
<li>西瓜</li>
<li>草莓</li>
</ul>
有序列表
<h5>成绩排行榜</h5>
<ol>
<li>xhh: 100</li>
<li>mcy: 99</li>
</ol>
自定义列表
<h5>帮助中心</h5>
<dl>
<dt></dt>
<dd>账户管理</dd>
<dd>购物指南</dd>
<dd>订单操作</dd>
</dl>
1.3.2 表格标签
表格基本标签
<h4>表格</h4>
<table>
<tr>
<td>name</td>
<td>age</td>
</tr>
<tr>
<td>xhh</td>
<td>18</td>
</tr>
<tr>
<td>mcy</td>
<td>9</td>
</tr>
</table>
相关属性
<h4>表格</h4>
<table border="1" width="300" height="200">
<tr>
<td>name</td>
<td>age</td>
</tr>
<tr>
<td>xhh</td>
<td>18</td>
</tr>
<tr>
<td>mcy</td>
<td>9</td>
</tr>
</table>
标题和表格单元头
<table border="1" width="300" height="200">
<caption><h3>姓名和年龄信息</h3></caption>
<tr>
<th>name</th>
<th>age</th>
</tr>
<tr>
<td>xhh</td>
<td>18</td>
</tr>
<tr>
<td>mcy</td>
<td>9</td>
</tr>
</table>
结构标签
<table border="1" width="300" height="200">
<caption><h3>姓名和年龄信息</h3></caption>
<thead>
<tr>
<th>name</th>
<th>age</th>
</tr>
</thead>
<tbody>
<tr>
<td>xhh</td>
<td>18</td>
</tr>
<tr>
<td>mcy</td>
<td>9</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>name-end</td>
<td>age-sum</td>
</tr>
</tfoot>
</table>
合并单元格
<table border="1" width="300" height="200">
<caption><h3>姓名和年龄信息</h3></caption>
<thead>
<tr>
<th>name</th>
<th>age</th>
</tr>
</thead>
<tbody>
<tr>
<td>xhh</td>
<td rowspan="2">18</td>
</tr>
<tr>
<td>mcy</td>
<!-- <td>9</td> -->
</tr>
</tbody>
<tfoot>
<tr>
<td>name-end</td>
<td>age-sum</td>
</tr>
</tfoot>
</table>
1.3.3 表单标签
input
<body>
<br><br><br><br>
<!-- form 实现按钮功能 -->
<form>
姓名: <input type="text" placeholder="请输入姓名"><br><br>
密码: <input type="password" placeholder="请输入密码"><br><br>
性别:<input type="radio" name="sex"> 男 <input type="radio" name="sex"> 女 <br><br>
爱好:<input type="checkbox"> 敲代码 <input type="checkbox"> 打篮球 <br><br>
<input type="file" multiple> <br><br>
<!-- 提交按钮 -->
<input type="submit">
<!-- 重置按钮 -->
<input type="reset">
<!-- 普通按钮 -->
<input type="button" value="xhh普通按钮">
</form>
</body>
button
<body>
<form>
<!-- 提交按钮 -->
<button type="submit">xhh-提交按钮</button>
<!-- 重置按钮 -->
<button type="reset">xhh-重置按钮</button>
<!-- 普通按钮 -->
<button type="button">xhh-普通按钮</button>
</form>
</body>
select
所在城市:<select>
<option>xhh</option>
<option selected>mcy</option>
<option>xyz</option>
</select>
textarea
<textarea cols="30" rows="10">
今天,还是喜欢你...
</textarea>
lable
<!-- 第一种 目的->点击文字也可以选择到框 -->
<!-- 第一种 -->
<input type="checkbox" id="one"><label for="one">敲代码</label>
<!-- 第二种 -->
<label>
<input type="checkbox">打篮球
</label>
1.3.4 语义化标签
1.3.5 字符实体
1.3.6 综合案例
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<header>
<!-- 大标题 -->
<h2>青春不常在,抓紧谈恋爱</h2><hr>
</header>
<section>
<form>
<!-- 主题内容 -->
昵称: <input type="text" placeholder="请输入昵称"><br><br>
性别: <input type="radio" name="sex"> 男 <input type="radio" name="sex"> 女<br><br>
生日: <input type="data" placeholder="1996/01/01"><br><br>
<select>
<option>上海</option>
<option selected>北京</option>
</select><br><br>
婚姻状况:
<input type="radio" name="hy" checked> 未婚
<input type="radio" name="hy"> 已婚
<input type="radio" name="hy"> 保密<br><br>
个人介绍: <br><textarea cols="40" rows="10"></textarea>
<h3>我承诺</h3>
<ul>
<li>18</li>
<li>have love</li>
</ul>
<label>
<input type="checkbox">同意所有条款<br><br>
</label>
<button type="submit">免费注册</button>
<button type="reset">重置</button><br><br>
<a href="#">点击回到顶端</a>
</form>
</section>
</body>
</html>
2 CSS
2.1 基本引入
基本用法
CSS的引入方式
2.2 基础选择器
2.2.1 标签选择器
2.2.2 类选择器
2.2.3 id选择器
2.2.4 通配符选择器
2.3 字体和文本样式
2.3.1 字体
字体大小
字体粗细
是否倾斜
常见的字体和字体系列
- swsf 可以省略前两个
2.3.2 文本
文本的缩进 text-indent
文本水平对齐方式 text-align
文本修饰 text-decoration
案例
2.3.3 line-height行高
2.3.4 (扩展)颜色取值
2.4 选择器进阶
2.4.1 复合选择器(空格和>)
后代选择器
子代选择器
2.4.2 并集选择器(,)
2.4.3 交集选择器(紧挨着)
2.4.4 Emmet语法
2.4.5 hover伪类选择器
2.4.6 进阶选择器的总结
2.5 背景相关属性
2.5.1 背景颜色
2.5.2 背景图片
2.5.3 背景平铺
2.5.4 背景位置
2.5.5 背景属性连写
2.5.6 拓展写法
2.6 元素显示模式
2.6.1 块级元素
2.6.2 块内元素
2.6.3 行块元素
2.6.4 元素显示模式转换
2.6.5 扩展
2.7 CSS三大特性
2.7.1 继承性
2.7.2 层叠性
2.7.3 优先级