You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

32 lines
853 B

<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>Document</title>
<style>
/* 当父元素一行中有剩余空间怎么解决? */
#div0 {
width: 380px;
background-color: blue;
display: flex;
flex-flow: row wrap;
/* justify-content 用来在存于剩余空间时,设置为间距的方式 */
justify-content: space-between;
}
#div0 div {
width: 100px;
height: 100px;
background-color: aqua;
}
</style>
</head>
<body>
<div id="div0">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
</div>
</body>
</html>