----
CSS Flex Train Station Challenge
Please share on social media or blogs! I spent a long time making this Flexbox challenge 🙂
CSS Flex Train Station Challenge 1
Learn CSS Flex by playing this CSS Flexbox Train Station game!
Park your flex train at provided ghost train station. Each train car must perfectly match position of the ghost train. You can accomplish this by changing flex properties and values in source code window below.
Details matter. Pay close attention to direction of each car in every challenge.
How To Play. To pass this challenge align your train with the ghost train by changing flex properties. They will be applied to the parent container to align flex elements represented by train cars. Click Park Button to test your code when you're ready.
Flex Challenge 1 - Align To Center
Get your flex train wagons parked at shown location to complete the challenge and go to next level.
Solution Hint (Click to unfold)
Hint: All you have to do is add 2 new properties justify-content and align-items to parent container and assign each a value! But which ones and why? Not sure? Head over to our CSS Flex Definitive Guide (it will teach you everything you need to know to pass this challenge) and then come back here.
Flex Container Code
Fun fact. The wheels inside each flex element are also flex elements.
CSS Flex Train Station Challenge 2
Learn CSS Flex by playing this CSS Flexbox Train Station game!
Park your flex train at provided ghost train station. Each train car must perfectly match position of the ghost train. You can accomplish this by changing flex properties and values in source code window below.
Details matter. Pay close attention to direction of each car in every challenge.
How To Play. To pass this challenge align your train with the ghost train by changing flex properties. They will be applied to the parent container to align flex elements represented by train cars. Click Park Button to test your code when you're ready.
Flex Challenge 2 - Align To End
Get your flex train wagons parked at shown location to complete the challenge and go to next level.
Solution Hint (Click to unfold)
Hint: All you have to do is add 2 new properties justify-content and align-items to parent container and assign each a value! But which ones and why? Not sure? Head over to our CSS Flex Definitive Guide (it will teach you everything you need to know to pass this challenge) and then come back here.
Flex Container Code