A Pen by liuxiaomingskm on CodePen.
Last active
January 29, 2020 05:16
-
-
Save liuxiaomingskm/46fc8cfd50c7033aecf52a9a5b2b0de5 to your computer and use it in GitHub Desktop.
Polygon Widget (练习了flex-basis flex-grow flex-shrink)
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
<div class="container"> | |
<div class="box"> | |
<h3>Rick and Morty the Game review: a fun romp blah blah</h3> | |
</div> | |
<div class="box middle"> | |
<h3>Lord of the Ring Seventeen million review: a fun romp blah blah</h3> </div> | |
<div class="box"> | |
<h3>Game of Thrones the game review: a fun romp blah blah</h3> | |
</div> | |
</div> |
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
.container{ | |
display:flex; | |
flex-wrap:wrap; | |
} | |
.box { | |
background:#cc0042; | |
flex:1 1 200px; // flex 1(grow) 1(shrink)200px(basis) | |
/* flex-basis:200px; | |
flex-grow: 1; */ | |
color:white; | |
font-family: Helvetica; | |
padding:20px; | |
transition:1s background; | |
} | |
.middle { | |
background:#b20039; | |
} | |
.box:hover { | |
background: #ff0052; | |
} | |
h3 { | |
font-size: 30px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment