New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css] 第44天 手写一个满屏品字布局的方案 #166
Labels
css
css
Comments
整体100%高度,上面50高度margin auto居中,下面50%高度俩float一半宽度。。应该符合题意把 |
flex布局 |
用grid布局是否好点 |
<title>Parcel Sandbox</title>
<style>
.box {
width: 100%;
justify-content: center;
display: flex;
top
first
second
|
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8">
<link rel="stylesheet" href="style.css">
</head>
<body>
<article class="container">
<div class="firstRow">
<div class="item"></div>
</div>
<div class="secondRow">
<div class="item"></div>
<div class="item"></div>
</div>
</article>
</body>
</html> //style.css
html, body{
height: 100%;
margin: 0;
padding: 0;
}
.container {
display: flex;
flex-direction: column;
flex-wrap: wrap;
width: 100%;
height: 100%;
}
.firstRow, .secondRow {
width: 100%;
height: 30%;
display: flex;
flex-direction: row;
justify-content: center;
margin: 10px 0;
}
.item {
background-color: red;
width: 40%;
height: 100%;
margin: 0 auto;
border-radius: 10%;
} |
两行 ,每行做flex布局 |
|
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
第44天 手写一个满屏品字布局的方案
The text was updated successfully, but these errors were encountered: