<ul class="example">
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
</ul>
* {
box-sizing: border-box;
}
body {
min-height: 100vh;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
}
ul {
padding: 0;
margin: 0;
}
li {
line-height: 50px;
width: 50px;
background: #eee;
margin: 10px 0;
text-align: center;
list-style-type: none;
}
li:nth-child(1) {
background: #a0dde2;
}
li:nth-child(2) {
background: #e2a0b4;
}
li:nth-child(3) {
background: #eec496;
}
li:nth-child(4) {
background: #a0e2c2;
}
.example {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.