Align Content
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="AlignContent.css">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Align Content</title>
</head>
<body>
<h2>Align Content:flex-start</h2>
<div id="start" >
<div id="red"></div>
<div id="green"></div>
<div id="blue"></div>
</div>
<h2>Align Content:flex-end</h2>
<div id="end">
<div id="orange"></div>
<div id="aqua"></div>
<div id="black"></div>
</div>
<h2>Align Content:center</h2>
<div id="center">
<div id="violet"></div>
<div id="indigo"></div>
<div id="yellow"></div>
</body>
</html>
CSS
#start{
height:500px;
width: 500px;
border: 2px solid black;
margin:auto;
display: flex;
flex-direction: row;
justify-content: flex-start;
flex-wrap: wrap;
align-content: flex-start;
align-content: space-around;
}
#red{
height:100px;
width: 100px;
background-color: red;
}
#blue{
height:100px;
width: 100px;
background-color: blue;
}
#green{
height:100px;
width: 100px;
background-color: green;
}
#end{
height:500px;
width: 500px;
border: 2px solid black;
margin:auto;
display: flex;
flex-direction: column-reverse;
justify-content:end ;
align-content: space-between;
}
#orange{
height:100px;
width: 100px;
background-color: orange;
}
#aqua{
height:100px;
width: 100px;
background-color: aqua;
}
#black{
height:100px;
width: 100px;
background-color: black;
}
#center{
height:500px;
width: 500px;
border: 2px solid black;
margin:auto;
display: flex;
flex-direction: column;
justify-content:center;
align-content: space-evenly;
}
#violet{
height:100px;
width: 100px;
background-color: violet;
}
#indigo{
height:100px;
width: 100px;
background-color: indigo;
}
#yellow{
height:100px;
width: 100px;
background-color: yellow;
}
Comments
Post a Comment