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

HTML5 and CSS3 Section

@guilhermerera

Desktop design screenshot for the Stats preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


This is my first challange ever here on FrontEnd mentor and I'm super excited about it! :D I don't have any specific question about this one, I just wanna hear some feedback about my HTML structure and CSS solution. Let me know what you think about my code. :)

Community feedback

Anna Leigh 5,135

@brasspetals

Posted

Hi, Guilherme! Congrats on submitting your first solution! 🎉 Excellent job on the image coloring, which is a big struggle for most people on this challenge. 🙌

A few suggestions:

  • Instead of using two img tags, I suggest using a picture element, which is incredibly useful in cases where you have two (or more) different images to switch between.
  • In the future I would avoid setting express heights, widths, paddings, etc. (basically most things to do with sizing and positioning) on the body, and instead use another container/wrapper div. It works ok for some of these smaller projects, but you will run into trouble on larger ones. You could probably take the width, height, and paddings and set them on your main container instead without issue.
  • It's also better, generally, for content to determine the height of an element rather than setting a specific px height. In fact if you remove the heights from your body, it looks like your solution doesn't change at all, so you could probably delete them. 👍You'll get into all of that when you get into responsive design. 😄 Speaking of, the resource page has some great links to learn Flexbox and Grid.

Again, good job on this solution and happy coding!

Marked as helpful

3

@guilhermerera

Posted

@brasspetals Thank you so much for your feedback and comments, Anna! It was really helpful and made me learn some new things. I had one of those WOW MOMENTS with the picture element. I bet it is pretty basic, but it was a huge step here.

The body/maincontent tip was pretty good. I'll try to look at my smaller projects as a part of a large one, so I can work my code organization/structure right from the beginning to avoid troubles with bad habbits in the future.

I updated the code with your tips and it look and feel way better now. Thanks again!

0
Anna Leigh 5,135

@brasspetals

Posted

@guilhermerera When I found out about the picture element a handful of months ago, it blew my mind too! How had I gone so long without knowing about this? Something similar you may find useful in future projects is srcset. It's great for situations when you have copies the same image (same dimensions/ratio) but in different resolutions (ex: smaller version for mobile). Here's more about srcset and responsive images on MDN.

Glad my suggestions helped! Looking forward to your next solution! 😄

1

@guilhermerera

Posted

@brasspetals I'll take a good look at srcset too, thanks a lot!

0
P
Patrick 14,285

@palgramming

Posted

Looks good but you might want to try to build a middle layout to use the space more effectively between the mobile and desktop layout. Using the desktop sized elements but in the mobile layout

1

@guilhermerera

Posted

@palgramming oh, nice sugestion, thanks! I'll try to build that. :D

0
Lorenzo 45

@LorenzoChio

Posted

Don't wanna read your code cause I'm also doing this one but congratulations! It looks great.

1

@guilhermerera

Posted

@LorenzoChio thanks! looking forward to check your solution too!

0
Lorenzo 45

@LorenzoChio

Posted

@guilhermerera Thanks, will post it here when it's up!

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