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 star
Not sure if you need your black keys to be independent blocks but here is an example
body {
background: #000;
}
.note-container {
width: 100%;
display: flex;
flex-flow: row nowrap;
}
.white-note {
position: relative;
width: 10%;
height: 400px;
background: #fff;
margin: 0 2px;
}
.white-note.black-note:after {
content: "";
position: absolute;
top: 0;
right: -25%;
width: 50%;
height: 50%;
background: #000;
z-index: 1;
}