Created
August 8, 2017 13:06
-
-
Save michael/7e1442fc8366102108b79d5e6d2698b4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Spreadsheet Layout with Flexbox</title> | |
<meta charset="UTF-8"> | |
<style> | |
body { | |
overflow: hidden; | |
} | |
/* apply a natural box layout model to all elements, but allowing components to change */ | |
html { | |
box-sizing: border-box; | |
} | |
*, *:before, *:after { | |
box-sizing: inherit; | |
} | |
.row { | |
display: flex; | |
flex-direction: row; | |
flex-wrap: nowrap; | |
} | |
.cell.highlighted { | |
/*overflow: visible;*/ | |
/*flex: 0 0 auto;*/ | |
background: green; | |
} | |
.cell.empty { | |
} | |
.cell { | |
flex: 0 0 auto; | |
display: flex; | |
width: 100px; | |
white-space: nowrap; | |
overflow: visible; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="spreadsheet"> | |
<div class="row"> | |
<div class="cell highlighted" style="width: 300px;"> | |
<div class="cell-content">HelloasdfsdFJ ALKSDJF LAKSDJF</div> | |
</div> | |
<!-- <div class="cell empty" style="width: 200px;"></div> --> | |
<div class="cell" style="width: 300px;"> | |
<div class="cell-content">Mehasd</div> | |
</div> | |
</div> | |
<div class="row"> | |
<div class="cell" style="width: 100px;">Hello</div> | |
<div class="cell" style="width: 200px;">World</div> | |
<div class="cell" style="width: 300px;">Meh</div> | |
</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment