Created
September 23, 2020 14:56
-
-
Save azamsharp/270261442c7daddf33c0b30e08d0a2ef to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* By default Flexbox have flex-direction: row */ | |
/* When FlexBox is row then justify content moves items left/right | |
When FlexBox is column then justify content moves items up/down | |
When FlexBox is row align-items moves up/down | |
When FlexBox is column align-items movies left-right | |
*/ | |
#container { | |
display: flex; | |
flex-wrap: wrap; | |
background-color: yellow; | |
justify-content: center; | |
height: 300px; | |
align-items: center; | |
} | |
.box { | |
width: 100px; | |
height: 100px; | |
background-color: blue; | |
margin: 10px; | |
display: flex; | |
flex-direction: column; | |
color: white; | |
} | |
.featured { | |
align-self: flex-start; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- RESPONSIVE DESIGN --> | |
<html> | |
<head> | |
<link rel="stylesheet" href="flex.css"> | |
</head> | |
<body> | |
<div id="container"> | |
<div class="box"> | |
<label>Item 1</label> | |
<label>Details</label> | |
</div> | |
<div class="box"> | |
Item 2 | |
</div> | |
<div class="box"> | |
Item 3 | |
</div> | |
<div class="box"> | |
Item 4 | |
</div> | |
<div class="box featured"> | |
Item 5 | |
</div> | |
<div class="box"> | |
Item 6 | |
</div> | |
<div class="box"> | |
Item 7 | |
</div> | |
<div class="box"> | |
Item 8 | |
</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment