I have 3 images vertically aligned in fixed height div. How can I make sure that the top and bottom padding between them remains even when an image is added or deleted.
I know I'm bound to stumble across this again the next time I search for it. Leaving this as a reference for myself. Difference is elements don't have to have fixed heights per-se:
http://codepen.io/anon/pen/ojBPaq?editors=110
HTML
- wefwfwefww efwefwfwfewfwef wefwfwf wefwfe wefwf wefwfwfwfwf wef wefwfe
CSS
* { box-sizing: border-box; }
ul {
list-style: none;
margin: 0;
padding: 0;
background: grey;
width: 500px;
height: 400px;
display: table;
}
li {
display: table-row;
background: aqua;
vertical-align: bottom;
}
.tile-wrap {
display: table-cell;
vertical-align: middle;
}
.one {
vertical-align: top;
}
.two {
vertical-align: middle;
}
.three {
vertical-align: bottom;
}
.tile-wrap .tile {
width: 100px;
min-height: 100px;
background: white;
border: 1px solid blue;
}