webveuje/csspress/demo/zishiying2.html

35 lines
664 B
HTML
Raw Normal View History

2021-01-28 09:06:45 +08:00
<!DOCTYPE html>
<html lang="en">
2021-03-23 10:58:10 +08:00
2021-01-28 09:06:45 +08:00
<head>
<meta charset="UTF-8">
2021-03-23 10:58:10 +08:00
<meta http-equiv="X-UA-Compatible" content="IE=edge">
2021-01-28 09:06:45 +08:00
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
2021-03-23 10:58:10 +08:00
<script>
document.querySelectorAll
</script>
2021-01-28 09:06:45 +08:00
<style>
*{
2021-03-23 10:58:10 +08:00
margin:0;
2021-01-28 09:06:45 +08:00
padding: 0;
}
2021-03-23 10:58:10 +08:00
html,
body {
width: 100%;
2021-01-28 09:06:45 +08:00
height: 100%;
}
.box{
2021-03-23 10:58:10 +08:00
width: 30%;
height: 30%;
2021-01-28 09:06:45 +08:00
background: pink;
}
</style>
</head>
2021-03-23 10:58:10 +08:00
2021-01-28 09:06:45 +08:00
<body>
2021-03-23 10:58:10 +08:00
百分比实现自适应
<div class="box"></div>
2021-01-28 09:06:45 +08:00
</body>
2021-03-23 10:58:10 +08:00
2021-01-28 09:06:45 +08:00
</html>