<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title></title>
visibility属性用于指定一个 元素应可见还是隐藏
visibility:visible;元素可视
visibility:hidden;元素隐藏
visibility隐藏元素后,继续占有原来的位置
如果想要原来的位置就用visibility:hidden
如果隐藏元素不想要原来的位置,就用display:none;
<style>
.peppa {
visibility: hidden;
width: 200px;
height: 200px;
background-color: pink;
}
.george {
width: 200px;
height: 200px;
background-color: skyblue;
}
</style>
</head>
<body>
<div class="peppa">佩奇</div>
<div class="george">乔治</div>
</body>
</html>