Skip to content

Instantly share code, notes, and snippets.

@Marco3jp
Last active November 26, 2019 20:42
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Marco3jp/229819d6bff0556dd81059f7068dffab to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>flex direction test page</title>
<style>
* {
box-sizing: border-box;
}
div {
border: 1px solid gray;
margin: 5px;
}
.height {
height: 100vh;
}
.flex {
display: flex;
flex-direction: column;
}
.percent-elm {
height: 40%;
}
.pixel-elm {
height: 500px;
}
</style>
</head>
<body>
<div class="flex">
<div>
<div>
<p>this elm include <strong>a</strong> 500px element</p>
<div class="pixel-elm">
</div>
</div>
<div class="percent-elm">
<button>Sample</button>
</div>
<div class="percent-elm">
</div>
</div>
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>sample page</title>
<style>
div {
border: 1px solid black;
margin: 5px;
}
#pixel {
height: 100px;
}
#percent {
height: 100%;
}
</style>
</head>
<body>
<div id="app">
<div>
<div id="pixel">
a
</div>
<div id="percent">
a
</div>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment