2018-08-17 17:36:50 +03:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<!--
|
|
|
|
Any copyright is dedicated to the Public Domain.
|
|
|
|
http://creativecommons.org/publicdomain/zero/1.0
|
|
|
|
-->
|
|
|
|
<html>
|
|
|
|
<head>
|
2018-08-18 09:45:39 +03:00
|
|
|
<title>CSS Test: Testing for full height grid container in a button.</title>
|
2018-08-17 17:36:50 +03:00
|
|
|
<meta charset="utf-8">
|
|
|
|
<style>
|
2018-08-18 09:45:39 +03:00
|
|
|
button {
|
|
|
|
vertical-align: top;
|
|
|
|
padding: 0;
|
|
|
|
border: solid 1px black;
|
|
|
|
background: lightblue;
|
|
|
|
width: 200px;
|
|
|
|
height: 200px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.grid {
|
2018-08-17 17:36:50 +03:00
|
|
|
display: inline-grid;
|
|
|
|
grid-template-columns: auto auto auto;
|
|
|
|
grid-template-rows: auto;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: stretch;
|
|
|
|
}
|
|
|
|
|
2018-08-18 09:45:39 +03:00
|
|
|
.grid > * {
|
|
|
|
margin: 1px;
|
|
|
|
background: teal;
|
2018-08-17 17:36:50 +03:00
|
|
|
min-height: 10px;
|
|
|
|
min-width: 10px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.vertical {
|
2018-08-18 09:45:39 +03:00
|
|
|
grid-template-columns: 1fr;
|
|
|
|
grid-template-rows: 1fr 1fr 1fr;
|
2018-08-17 17:36:50 +03:00
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<!-- 3 columns/1 row -->
|
2018-08-18 09:45:39 +03:00
|
|
|
<button class="grid">
|
2018-08-17 17:36:50 +03:00
|
|
|
<div></div>
|
|
|
|
<div></div>
|
|
|
|
<div></div>
|
|
|
|
</button>
|
2018-08-18 09:45:39 +03:00
|
|
|
<!-- 1 column/3 rows, using "fr" units to fill container -->
|
|
|
|
<button class="grid vertical">
|
2018-08-17 17:36:50 +03:00
|
|
|
<div></div>
|
|
|
|
<div></div>
|
|
|
|
<div></div>
|
|
|
|
</button>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
|