How to create a completely flexible piano keyboard with HTML and CSS
问题 I'm trying to create a piano keyboard that will keep it's elements ratios using flex box, but can't seem to make the black notes stay the same width or height once I start changing the window size. Here is a fiddle body{ width: 800px; height: 200px; display: flex; } #kbd { padding: 1%; flex-flow: column; display: flex; flex: 4; } #keys { display: flex; flex: 8; justify-content: center; } .note { flex: 1; display: inline-flex; align-items: center; } .black { justify-content: center; position: