Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Responsive Landing Page - Flex Box

Joeβ€’ 60

@Joe-Lindie

Desktop design screenshot for the Sunnyside agency landing page coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

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.

  1. Desktop view: Logo and navbar not on the same line.
  2. 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 :) ).
  3. 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?
  4. The hover state of the .svg social media icons is not working? (Is it todo with it being a .svg file?)
  5. 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

Community feedback

Amonβ€’ 2,560

@A-amon

Posted

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 setting flex:1; to your picture tags within instead of setting width:25vw;. Then, on mobile, simply use a media query to change that to flex: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

0

Joeβ€’ 60

@Joe-Lindie

Posted

Hello @A-amon,

Thanks for your help with aligning the navbar/logo - It seemed so obvious once you said it. I must have been staring at the code for way too long.

Thanks for all your other tips, too!

0
Amonβ€’ 2,560

@A-amon

Posted

@Joe-Lindie It's always good to take a break in between, just to clear our mental "cache" πŸ˜‰

0

@IEdiong

Posted

  1. 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

0

@IEdiong

Posted

Hi Joe, congratulations on finishing your second challenge here. A quick suggestion, try completing the newbies and some simple junior challenges as this would prepare you to handle the more difficult challenges.

Possible solutions:

  1. 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

0

Joeβ€’ 60

@Joe-Lindie

Posted

Hello @IEdiong,

Thanks for your help. Especially targeting the nth-child. It was driving me nuts!

@IEdiong I completed a newbie challenge and thought I'd push myself with a junior. It's is quite a jump. haha

Cheers!

1

@martinelias1312

Posted

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

0

Joeβ€’ 60

@Joe-Lindie

Posted

Hello @smradupan ,

Thanks for the tip. That helped fix the issue of the gap.

I removed the id="egg-img" too as I was not using it.

0

Please log in to post a comment

Log in with GitHub
Discord logo

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