01-CSS3图片模糊处理filter
<!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图片模糊处理filter</title>
<style>
img {
/* blur是一个函数,小括号里面数值越大,图片越模糊 注意数值要加单位px */
filter: blur(5px);
}
/* 鼠标一经过图片,由模糊变成不模糊的效果 */
img:hover {
filter: blur(0);
}
</style>
</head>
<body>
<img src="tudou.jpg" alt="">
</body>
</html>
效果展示
02-CSS3宽度calc函数
<!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宽度calc函数</title>
<style>
.father {
width: 300px;
height: 200px;
background-color: pink;
}
.son {
/* width: 150px; */
/* width: calc(150px+30px); */
width: calc(100% - 30px);
height: 30px;
background-color: skyblue;
}
</style>
</head>
<body>
<!-- 需求是子盒子宽度永远比父盒子小30像素 -->
<div class="father">
<div class="son"></div>
</div>
</body>
</html>
效果展示