How to align containers dynamically โ” | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 11

How to align containers dynamically โ”

I need help in creating a rule that determines how (in which order) my containers are displayed on the website. If 100% width of the screen is = 993px or higher, then my 3 containers (m1, m2, m3) should be displayed inline block (as in the example). But if it is <= 992px, then the containers should be displayed one below the other (as in the example). The order must be: m2, m1, m3 and with width = 100% in that case. How can I make sure that this is going to work? https://code.sololearn.com/W1WXX4s84H43/?ref=app

23rd Nov 2020, 10:30 AM
Miss Selenophilia ๐ŸŒ™
Miss Selenophilia ๐ŸŒ™ - avatar
2 Answers
+ 3
Here is the solution. I hope it is good. https://code.sololearn.com/WKZ9W4PG8CMP/?ref=app
23rd Nov 2020, 11:16 AM
๐Ÿ‡ Alex Tuศ™inean ๐Ÿ’œ
๐Ÿ‡ Alex Tuศ™inean ๐Ÿ’œ - avatar
+ 1
Check out CSS media queries, they allow you to set your rules differently for different screen sizes.
23rd Nov 2020, 10:45 AM
CHMD
CHMD - avatar