A Pen by Emílio Vieira on CodePen.
Created
June 16, 2022 03:00
-
-
Save emiliojva/c14729b72e15cb84da340b8e055d8b65 to your computer and use it in GitHub Desktop.
01-CSS-Flexbox-display
This file contains 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
<h1>display block;</h1> | |
<section class='container'> | |
<div class="item">1</div> | |
<div class="item">2</div> | |
<div class="item">3</div> | |
<div class="item">4</div> | |
</section> | |
<h1>display flex;</h1> | |
<section class='container flex'> | |
<div class="item">1</div> | |
<div class="item">2</div> | |
<div class="item">3</div> | |
<div class="item">4</div> | |
</section> | |
<h1>display flex;</h1> | |
<section class='container flex'> | |
<div class="item">Teste 1</div> | |
<div class="item">Teste 2</div> | |
<div class="item">Teste 3</div> | |
<div class="item">Teste 4</div> | |
<div class="item">Teste 5</div> | |
<div class="item">Teste 6</div> | |
<div class="item">Teste 7</div> | |
</section> | |
<h1>display flex; // flex-item-1</h1> | |
<section class='container flex'> | |
<div class="item flex-item-1">Teste 1</div> | |
<div class="item flex-item-1">Teste 2</div> | |
<div class="item flex-item-1">Teste 3</div> | |
</section> |
This file contains 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
body { | |
font-family: monospace; | |
color: #333; | |
} | |
.container { | |
max-width: 420px; | |
margin: 0 auto; | |
border: 1px solid black; | |
padding: 0px; | |
} | |
.flex { | |
display: flex; | |
} | |
.flex-item-1 { | |
flex: 1; | |
} | |
.item { | |
background: tomato; | |
margin: 5px; | |
text-align: center; | |
font-size: 1.5em; | |
} | |
h1 { | |
text-align: center; | |
margin: 20px 0 0 0; | |
font-size: 1.25em; | |
font-weight: normal; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment