Skip to content

Instantly share code, notes, and snippets.

@liuxiaomingskm
Last active January 29, 2020 05:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liuxiaomingskm/46fc8cfd50c7033aecf52a9a5b2b0de5 to your computer and use it in GitHub Desktop.
Save liuxiaomingskm/46fc8cfd50c7033aecf52a9a5b2b0de5 to your computer and use it in GitHub Desktop.
Polygon Widget (练习了flex-basis flex-grow flex-shrink)
<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>
.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