一、web 服务器
1.什么是服务器
(1)本地服务器
(2)远程服务器
2.申请免费空间以及网站上传
二、CSS 2D转换
1. 2D转换之translate
(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>2D转换之translate</title>
<style>
/* 移动盒子的位置:定位 盒子的外边距 2d转换移动 */
div {
width: 200px;
height: 200px;
background-color: pink;
/* x就是x轴上移动位置 y就是y轴上移动位置 中间用逗号分隔 */
/* transform: translate(x,y); */
/* transform: translate(100px, 100px); */
/* 1.只移动x坐标 */
/* transform: translate(100px, 0); */
/* transform: translateX(100px); */
/* 2.只移动y坐标 */
/* transform: translate(0, 100px); */
/* transform: translateY(100px); */
}
div:first-child {
transform: translate(30px, 30px);
}
div:last-child {
background-color: purple;
}
</style>
</head>
<body>
<div></div>
<div></div>
</body>
</html>
(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>让盒子实现水平和垂直居中</title>
<style>
div {
position: relative;
width: 500px;
height: 500px;
background-color: pink;
/* 1. translate里面的参数可以用 % */
/* 2. 参数是% 移动的距离是盒子自身的宽度或者高度来%的 */
/* 这里的50% 就是50px 因为盒子宽度是 100px */
/* transform: translateX(50%); */
}
p {
position: absolute;
top: 50%;
left: 50%;
width: 200px;
height: 200px;
background-color: purple;
/* margin-top: -100px;
margin-left: -100px; */
transform: translate(-50%, -50%);
}
span {
/* translate对于行内元素是无效的 */
transform: translate(100px, 100px);
}
</style>
</head>
<body>
<div>
<p></p>
</div>
<span>123</span>
</body>
</html>
2. 2D转换之rotate
(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>2D转换之旋转rotate</title>
<style>
img {
width: 150px;
/* 顺时针旋转45度 */
/* transform: rotate(45deg); */
border-radius: 50%;
border: 5px solid pink;
/* 过渡写到本身上,谁做动画给谁加 */
transition: all 0.3s;
}
img:hover {
transform: rotate(360deg);
}
</style>
</head>
<body>
<img src="imgs/111.jpg" alt="">
</body>
</html>
(2)CSS3三角
<!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>CSS3书写三角</title>
<style>
div {
position: relative;
width: 249px;
height: 35px;
border: 1px solid #ccc;
}
div::after {
content: '';
position: absolute;
top: 8px;
right: 15px;
width: 10px;
height: 10px;
border-right: 1px solid #000;
border-bottom: 1px solid #000;
transform: rotate(45deg);
transition: all 0.6s;
}
/* 鼠标经过div 里面的三角旋转 */
div:hover::after {
/* 45+180 */
transform: rotate(225deg);
}
</style>
</head>
<body>
<div></div>
</body>
</html>
(3)设置转换中心点
<!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>设置元素转换中心点</title>
<style>
div {
width: 200px;
height: 200px;
background-color: pink;
margin: 100px auto;
transition: all 1s;
/* 1.可以跟方位名词 */
/* 2.默认是50% 50% 即center center */
/* transform-origin: left bottom; */
/* 3.可以是像素px */
transform-origin: 50px 50px;
}
div:hover {
transform: rotate(360deg);
}
</style>
</head>
<body>
<div></div>
</body>
</html>
(4)旋转中心点案例
<!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>旋转中心案例</title>
<style>
div {
overflow: hidden;
width: 200px;
height: 200px;
border: 1px solid pink;
margin: 100px auto;
}
div::before {
content: '啦啦';
display: block;
width: 100%;
height: 100%;
background-color: hotpink;
transform-origin: left bottom;
transform: rotate(180deg);
transition: all 0.6s;
}
/* 鼠标经过div 里面的before复原 */
div:hover::before {
transform: rotate(0deg);
}
</style>
</head>
<body>
<div></div>
</body>
</html>