Skip to content

Instantly share code, notes, and snippets.

@hata6502
Created February 12, 2019 13:23
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 hata6502/3888386d7cb04aff850a02a161d880d1 to your computer and use it in GitHub Desktop.
Save hata6502/3888386d7cb04aff850a02a161d880d1 to your computer and use it in GitHub Desktop.
Flexbox と SCSS のテスト
<html>
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>Flex Test</h1>
<div class="flex-container">
<div class="flex-item">
<h2>Item A</h2>
<p>ghttedscvbgfhyt4rewdscvbnytredscvbghtyrewdscxvbghtyrewdsdvbgfhtrewdscvbgjytrewdscxvbght</p>
</div>
<div class="flex-item">
<h2>Item B</h2>
<p>ddvfbghgredsfghtrewdvgnhedsafbgjgefdsvbmhtrdsvbnhjytewscnhjytrewdscvbnhjyutewsaddfghjkuytrewqertyuiluytrewqertyukiluytrew</p>
</div>
<div class="flex-item">
<h2>Item C</h2>
<p>flkuytresdghjkiu654ewsdghjkiu6543wsdhjuy</p>
</div>
<div class="flex-item">
<h2>Item D</h2>
<p>keokofkeopfkeokfopekfopefkopek</p>
</div>
<div class="flex-item">
<h2>Item E</h2>
<p>sdfghjklii7543eqwdscbnjh,iul8u56e3rwdghyjtefbyhjitjvirjoi4tjiojoierjoirejiejoptoertriutiutioerutioutiueutoiwuituioetuioerutioewutopuip</p>
</div>
</div>
</body>
</html>
.flex-container {
display: flex;
flex-wrap: wrap;
justify-content: center;
border: 1px solid black;
}
.flex-item {
width: 25%; // flex-basis は変化する
margin: 1em;
padding: 0.5em;
border: 1px solid black;
word-wrap: break-word;
h2 {
margin: 0.5ex;
text-align: center;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment