You can try something like this. Essentially just make two different ul‘s then nest it in a wrapper. Then you can tell the browser to switch to flex-column for phones. Resize the browser to see the effect.
ul {
display: flex;
flex-direction: column;
align-items: center;
margin: 0;
}
.wrapper {
display: flex;
justify-content: center;
}
/* change to column for phones */
@media only screen and (max-width: 600px) {
.wrapper {
flex-direction: column;
}
}
I want my elements to be in the middle of the screen and arranged vertically when on the mobile phone, but when switching to the tablet, the screen I hope to present is two elements in a row, presented from left to right!
Attached is the schematic diagram, but I’m stuck and don’t know how to implement such a layout.
ul {
display: flex;
flex-direction: column;
align-items: center;
}
@media (min-width: 768px) {
ul {
flex-direction: row;
}
}