Two div boxes(purple, pink), how to fix that white space above pink box?
HTML代码-
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lecture 3</title>
</head>
<body>
<main>
<div class="box1"> man </div><div class="box2"> man2 </div>
</main>
<footer>
<div class="foot">
Copyright © Mayank Daga
</div>
</footer>
</body>
</html>
div部件的CSS代码
.box1{
background-color: violet;
display: inline-block;
width:50%;
padding: 5px;
box-sizing: border-box;
font-family: 'Baloo Bhai 2', cursive;
height:120vh;
}
.box2{
background-color: pink;
display: inline-block;
width:50%;
padding: 5px;
box-sizing: border-box;
font-family: 'Baloo Bhai 2', cursive;
height:120vh;
}
我期望不能有任何白色,它必须是统一的。
1条答案
按热度按时间fnx2tebb1#
具有
row
方向的flex
和align-items: flex-start
应该在这里工作。