Responsive Landing Page - Flex Box

Solution retrospective
Good evening,
This is my second Frontend Mentor project, and it was a little too difficult for me. (I've only been studying since September)
There are several bugs I can't fix.
- Desktop view: Logo and navbar not on the same line.
- I used the nth-child CSS rule to change the color of the 'contact' tab in desktop view. It's not working. (I have the hover state working though :) ).
- In desktop & Mobile view I used flexbox to manipulate the images. I am getting a white gap on the rows. How do you remove it?
- The hover state of the .svg social media icons is not working? (Is it todo with it being a .svg file?)
- There is a problem with my JS for the hamburger menu. If you open the hamburger menu and change the screen size, you'll see what I mean.
I'm sure there are plenty of other issues, but for my second project, I don't think it's too bad. ALL feedback is welcome.
If anyone could help me fix these bugs, I'd appreciate it.
Lots of love to my web dev community,
Joe
Please log in to post a comment
Log in with GitHubCommunity feedback
- @A-amon
Hello! Amazing work there~ 😀
I've got a few suggestions:
- To align the logo and navbar links, you can add this code to your
.nav-bar
display:flex; align-items:center; justify-content:space-between;
- I don't think you have set the hover state for your social media links/icons. Anyhow, I would usually use the SVG code itself instead of img for these since I can more freely change the icons' color. You can refer to this 😁
- Looks like your
.display-img
images couldn't fit inside a row on laptop size. You can fix this by settingflex:1;
to your picture tags within instead of settingwidth:25vw;
. Then, on mobile, simply use a media query to change that toflex:100vw;
. - For your
.show
navbar, you can use media query to override/reset.show
styling on desktop sizes. 🖊 - You should use
<button>
for the hamburger button since it's a well, button. 😂 I will let screen reader users to know it's one. Check this out 😉. - The 'Learn More' text should be links 🔗 instead so they should be using
<a>
tags. - The social media links should have a text telling screen reader users what each link is for. You can use the
aria-label
attribute on the<a>
tags and set it to 'Facebook' or other values, then leave the alt attribute empty (This is what I would do 😀). You can check this out.
Marked as helpful - To align the logo and navbar links, you can add this code to your
- @IEdiong
- Set a media query to change the layout of the
.nav-bar
.
Some other things you should look into:
- Look into the accessibility and HTML issues raised here.
I hope this was helpful, Shalom!
Marked as helpful - Set a media query to change the layout of the
- @IEdiong
Hi Joe, congratulations on finishing your second challenge here. A quick suggestion, try completing the
newbies
and some simplejunior
challenges as this would prepare you to handle the more difficult challenges.Possible solutions:
- You can add the following CSS rules
.nav-bar { display: flex; align-items: center; justify-content: space-between; }
from here you can add more rules to make it look as you want. 2. I believe you selected the contact with the nth-child correctly but you set the rules wrong, try this instead
li:nth-child(4) { background-color: #fff; } li:nth-child(4) a { color: var(--Very-dark-blue); }
this is because the rules set in the
.nav-item a
selector is more specific than the one you had set. For more info look up CSS Specificity.Marked as helpful - @martinelias1312
Hello Joe,
Some suggestions from me:
gaps fixing:
.Random-img { display: block; }
.box{ display: block;}
hover fix (works for me):
.socials a:hover { }
At your Egg image you used
id="egg-img"
for <img> and <source> element too. There should be just one unique id.Anyways good job on your second challenge! :)
Marked as helpful
Join 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