Design comparison
Solution retrospective
I am still a newbie when it comes to CSS, I think the most difficult part was to:
- Have a proper layout with sections and divs in HTML
- Setting height and width on DIVs make some CSS perform some unexpected behavior.
Community feedback
- @correlucasPosted about 2 years ago
👾Hello Robert Gatt, Congratulations on completing this challenge!
I've just opened your live site and I can say that you did a great job putting everything together! There's some tips to improve your solution.I saw that you’ve used
flexbox
to place the content and create the layout.I think the best way to build this component with two columns is by using
GRID LAYOUT
since it is simpler to manage the columns and then create the media query for mobile. Here’s the steps to create it withgrid
create the main block to hold all the content (you can use<main>
to wrap), set itswidth
asmax-width: 900px
(it's the container size) anddisplay: grid
/grid-template-column: 1fr 1fr
(this means that your component will have two columns with 50% of the container width each thats 450px). To manage the column with the text use flexbox andgap
to give it the spacing between the texts or usepadding-bottom
to separate them.Then to create the mobile version, all you need to do is to change the container flow vertically with
grid-template-column: 1fr
.✌️ I hope this helps you and happy coding!
Marked as helpful1@RobertGattPosted about 2 years ago@correlucas thank you for your detailed message and your advice, much appreciated! I will keep that in mind.
1@correlucasPosted about 2 years ago@RobertGatt Then say me if was useful Robert. Keep it up =)
0 - @hyrongennikePosted about 2 years ago
Hi @n3rub1,
nice job on your first attempt of the challenge
You can add the following to get closer to the design.
.outerBox { min-height: 100vh; align-items: center; justify-content: center; margin: 0; padding: 0; } .topDiv > div { flex: 1; } .topDiv { max-width: 800px; height: 100%; }
0@RobertGattPosted about 2 years ago@hyrongennike thanks for your reply. I will try that out.
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord