1.嵌套列表
<!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>
<p>
<strong>好美味小吃</strong>
</p>
<ul>
<li>
小吃类
<ul>
<li>煮粉干</li>
<li>拌青菜</li>
<li>蛋炒饭</li>
<li>煎蛋</li>
</ul>
</li>
<li>
卤味类
<ul>
<li>鸭肠</li>
<li>面筋</li>
<li>牛肚</li>
<li>猪耳朵</li>
<li>猪头羊</li>
<li>大肠</li>
<li>鱿鱼</li>
</ul>
</li>
<li>
套餐类
<ul>
<li>卤面筋饭</li>
<li>猪肉肉饭</li>
<li>猪耳朵饭</li>
<li>卤猪脚饭</li>
</ul>
</li>
<li>
<ul>
<li>猪蹄黄豆</li>
<li>猪肚链子</li>
<li>猪心枸杞</li>
<li>羊肉枸杞</li>
</ul>
</li>
</ul>
<p>
亲,20元以上可送餐哦!!
</p>
</body>
</html>
在这里插入代码片
2.表格标签
2.1语义化标签
tHead,tBody,tFood
注:在一个table中,tBody是可以多次出现,但是tHead,tFood只能出现一次
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>
<table>
<tr>
<th>日期</th>
<th>天气情况</th>
<th>出行状况</th>
</tr>
<tr>
<td>2022年10月21日</td>
<td>晴</td>
<td>天气晴朗,适合出行</td>
</tr>
<tr>
<td>2022年10月22日</td>
<td>小雨</td>
<td>会有小雨,减少出行</td>
</tr>
</table>
</body>
</html>
3.表格属性
align:left,center,right
valign:top,middle,bottom
<!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>
<table border="1"cellpadding="30"cellspacing="30">
<tr align="left">
<th colspan="2">日期</th>
<th>天气情况</th>
<th>出行状况</th>
</tr>
<tr valiqn="top">
<td rowspan="2">2022年10月21日</td>
<td>白天</td>
<td>晴</td>
<td>天气晴朗,适合出行</td>
</tr>
<tr>
<td>白天</td>
<td>小雨</td>
<td>会有小雨,减少出行</td>
</tr>
<tr valiqn="bottom">
<td rowspan="2">2022年10月21日</td>
<td>夜晚</td>
<td>晴</td>
<td>天气晴朗,适合出行</td>
</tr>
<tr>
<td>夜晚</td>
<td>小雨</td>
<td>会有小雨,减少出行</td>
</tr>
</table>
</body>
</html>
4.表单标签(1)
<!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>
<from action="http://www.baidu.com">
<h2>输入框;</h2>
<input type="text" placeholder="请输入用户名">
<h2>密码框:</h2>
<input type="password">
<h2>复选框</h2>
<input type="checkbox" checked>西瓜
<input type="checkbox" checked>柚子
<input type="checkbox" disabled>石榴
<h2>单选框</h2>
<input type="radio"name="gender">白天
<input type="radio"name="gender">黑夜
<h2>上传文件</h2>
<input type="file">
<h2>提交按钮和重置按钮</h2>
<input type="submit">
<input type="reset">
</from>
</body>
</html>
5.表单标签(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>
<from action="http://www.baidu.com">
<h2>电子邮箱;</h2>
<input type="text">
<h2>设置密码:</h2>
<input type="password">
<h2>真实姓名;</h2>
<input type="text">
<h2>单选框</h2>
<input type="radio"name="gender">女生
<input type="radio"name="gender">男生
<h2>生日</h2>
<select>
<option selected disabled>请选择</option>
<option>2004</option>
<option>2003</option>
<option>2002</option>
<option>2001</option>
</select>
<select>
<option selected disabled>请选择</option>
<option>12</option>
<option>11</option>
<option>10</option>
<option>9</option>
</select>
<select>
<option selected disabled>请选择</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
</select>
<h2>我现在</h2>
<input type="text" placeholder="请选择身份">
<select>
<option selected disabled>请选择身份</option>
<option>学生</option>
<option>老师</option>
<h2>验证码:</h2>
</from>
</body>
</html>
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>
<form>
<table border="1"cellpadding="30">
<tBody>
<tr align="center">
<td rowspan="4">总体信息</td>
<td colspan="2">用户信息</td>
</tr>
<tr align="right">
<td>用户名:</td>
<td><input type="text" placeholder="请输入用户名"></td>
</tr>
<tr align="right">
<td>密码:</td>
<td><input type="text" placeholder="请输入密码"></td>
</tr>
<tr align="center">
<td colspan="2">
<input type="submit">
<input type="reset">
</td>
</tr>
</tBody>
</table>
</form>
</body>
</html>
表格<table>定义,每个表格有若干行由<tr>定义,每行被分为若干的单元格由<td>定义,<th>表头
7.div和span
div:做一个区域划分的块
span:对文字进行修饰,内联
8.css基础语法
8.1
width:宽
height:高
background-color:背景色
长度单位:
px->像素
%->百分比
<!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>
<style>
div{width:100%;height:100px; background-color:greenyellow}
span{background-color: blueviolet;}
</style>
</head>
<body>
<div>1234567</div>
<span>0987654</span>
</body>
</html>
8.2CSS注释
快捷键:shift+alt+a
ctrl+/
<!-- css注释 -->
9内联样式与内部样式
CSS样式的引入方式
- 内联样式:style属性
- 内部样式:style标签
区别:
内部样式代码可以复用
<style>
div{width:100%;height:100px; background-color:greenyellow}
/* span{background-color: blueviolet;} */
</style>
</head>
<body>
<!-- <div style="width:100%"height:100px; background-color:greenyellow>1234567</div> -->
<div>123456789</div>
10.外部样式
引入一个单独的css文件,name.css
通过link标签引入外部资源,rel属性指定资源跟页面的关系,href属性资源的地址
通过@import(不建议)
<link rel="stylesheet"href="./common.css">
<title>Document</title>
</head>
<body>
<div>这是一个快</div>
11.css颜色表示
工具:FeHelper,Photoshop
<!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>
<style>
div{width:100px;height:100px;background-color:red ;}
div{width:200px;height:150px;background-color:#000000;}
</style>
</head>
<body>
<div>色块</div>
</body>
</html>
12.css背景样式
<!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>
<style>
#div1{ width:1400px;height:800px;background-image:url(./img/1.jpg;);background-attachment: fixed;}
#div1{ width:1400px;height:800px;background-image:url(./img/2.jpg;);background-attachment: fixed;}
#div1{ width:1400px;height:800px;background-image:url(./img/3.jpg;);background-attachment: fixed;}
</style>
</head>
<body>
<div id="div1"></div>
<from action="http://www.baidu.com">
<h2>电子邮箱;</h2>
<input type="text">
<h2>设置密码:</h2>
<input type="password">
<h2>真实姓名;</h2>
<input type="text">
<h2>单选框</h2>
<input type="radio"name="gender">女生
<input type="radio"name="gender">男生
<h2>生日</h2>
<select>
<option selected disabled>请选择</option>
<option>2004</option>
<option>2003</option>
<option>2002</option>
<option>2001</option>
</select>
<select>
<option selected disabled>请选择</option>
<option>12</option>
<option>11</option>
<option>10</option>
<option>9</option>
</select>
<select>
<option selected disabled>请选择</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
</select>
<h2>我现在</h2>
<input type="text" placeholder="请选择身份">
<select>
<option selected disabled>请选择身份</option>
<option>学生</option>
<option>老师</option>
<h2>验证码:</h2>
</from>
<div id="div2"></div>
<form>
<table border="1"cellpadding="30">
<tBody>
<tr align="center">
<td rowspan="4">总体信息</td>
<td colspan="2">用户信息</td>
</tr>
<tr align="right">
<td>用户名:</td>
<td><input type="text" placeholder="请输入用户名"></td>
</tr>
<tr align="right">
<td>密码:</td>
<td><input type="text" placeholder="请输入密码"></td>
</tr>
<tr align="center">
<td colspan="2">
<input type="submit">
<input type="reset">
</td>
</tr>
</tBody>
</table>
</form>
<div id="div3"></div>
<form>
<table border="1"cellpadding="30">
<tBody>
<tr align="center">
<td rowspan="4">总体信息</td>
<td colspan="2">用户信息</td>
</tr>
<tr align="right">
<td>用户名:</td>
<td><input type="text" placeholder="请输入用户名"></td>
</tr>
<tr align="right">
<td>密码:</td>
<td><input type="text" placeholder="请输入密码"></td>
</tr>
<tr align="center">
<td colspan="2">
<input type="submit">
<input type="reset">
</td>
</tr>
</tBody>
</table>
</form>
</body>
</html>
</body>
</html>
13css边框样式
<!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>
<style>
div{width:300px;height:300px;border-style:red}
</style>
</head>
<body>
<div></div>
</body>
</html>
14.css边框(三角形)
<style>
body{background-color: green;}
div{ width:0px;height:0px;
border-top-color:transparent;
border-top-style:solid;
border-top-width:30px;;
border-right-color:red;
border-right-style:solid;
border-right-width:30px;;
border-bottom-color:transparent;
border-bottom-style:solid;
border-bottom-width:30px;;
border-left-color: transparent;
border-left-style:solid;
border-left-width:30px;;
}
</style>
</head>
<body>
<div></div>
</body>
</html>
15.css文字样式
<style>
div{ font-family: SimSun;}
</style>
</head>
<body>
<div>这是一段文字</div>
- 字体中有空格用引号引
- 多个字体类型的设置目的
16css字体样式(2)
注;字体大小一般为偶数
默认:16px
写法:number(px)
font-weight:字体粗细
模式:
正常(normal)加粗(bold)
number(100-500正常、600-900加粗) font-style:字体样式
模式:正常(normal) 斜体(italic)
17.css段落样式
<style>
p{ width:300px;text-decoration:line-through underline overline;}
</style>
</head>
<body>
<p>南京邮电大学通达学院</p>
</body>
18.文本缩进与文本对齐
p{ text-indent: 2em;font-size:18px}
</style>
</head>
<body>
<p>南京邮电大学通达学院</p>
19.css段落样式
<style>
/*p{ width:300px;text-decoration:line-through underline overline;}*/
/*p{ text-indent: 2em;font-size:18px}*/
/* p{line-height:1;}*/
p{letter-spacing:30px;}
/* p{word-spacing:10px;}*/
</style>
</head>
<body>
<p>南京邮电大学通达学院南京邮电大学通达学院,位于江苏省扬州市,学院始建于1999年,是经中华人民共和国教育部批准、由南京邮电大学创办的全日制普通本科高等学校(独立学院)。 [1]
截止2022年9月,学院占地893亩,现有在校生10428人,南京邮电大学通达学院南京邮电大学通达学院,位于江苏省扬州市,学院始建于1999年,是经中华人民共和国教育部批准、由南京邮电大学创办的全日制普通本科高等学校(独立学院)。 [1]
截止2022年9月,学院占地893亩,现有在校生10428人,南京邮电大学通达学院南京邮电大学通达学院,位于江苏省扬州市,学院始建于1999年,是经中华人民共和国教育部批准、由南京邮电大学创办的全日制普通本科高等学校(独立学院)。 [1]
截止2022年9月,学院占地893亩,现有在校生10428人
</p>
20.文章段落
<style>
h1{ text-align: center;color:blueviolet}
h2{ text-align: center;color:blue}
</style>
</head>
<body>
<h1>南京邮电大学通达学院南京邮电大学通达学院</h1>
<h2>位于江苏省扬州市,学院始建于1999年,是经中华人民共和国教育部批准、由南京邮电大学创办的全日制普通本科高等学校(独立学院)。 [1]
截止2022年9月,学院占地893亩,现有在校生10428人,南京邮电大学通达学院南京邮电大学通达学院,位于江苏省扬州市,学院始建于1999年,是经中华人民共和国教育部批准、由南京邮电大学创办的全日制普通本科高等学校(独立学院)。 [1]
截止2022年9月,学院占地893亩,现有在校生10428人,南京邮电大学通达学院南京邮电大学通达学院,位于江苏省扬州市,学院始建于1999年,是经中华人民共和国教育部批准、由南京邮电大学创办的全日制普通本科高等学校(独立学院)。 [1]
截止2022年9月,学院占地893亩,现有在校生10428人</h2>
21.css复合样式
1.一个CSS属性只控制一种样式,叫做单一样式。
2.一个CSS属性控制多种样式,叫做复合样式。
22.css选择器
<!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>
<style>
#div1{width: 100px;height: 100px;background: black;}
#div2{width: 100px;height: 100px;background: gray;}
</style>
</head>
<body>
<div id="div1"></div>
<div id="div2"></div>
</body>
</html>