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

First HTML/CSS Challenge how do I get the right look for the image??

JFREUN 20

@JFREUN

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


Hi there! :) I would love some feedback!

I only just started learning CSS (loving it) and this project was quite the challenge for me. I think there are a couple of things I couldn't figure out.

How do I make the image look more like the solution? I tried applying filters but I don't think I achieved the exact look.

How do I space out the three stats evenly while keeping them in one line? Whenever I tried spacing them out more one always moved below.

Also I don't really know how to create this site for mobile so sorry if it looks weird in different dimensions.

Let me know anything I could improve!

Community feedback

Millz 530

@Brezus

Posted

hey im a beginner as well for the stats you could put them in a ul and make them list items and set the ul/containers display to flex and that should lay them beside each other or you can go on the individual ul li elements and set them to display:inline-block that will lay them down side by side and then you can set the margins/padding to increase the space they take up and as for the mobile design i follow this youtuber called kevin powell he advises that you do the mobile design first and then use media queries to change the width and other stuff of your design to accomodate wider screens

0
Francel 370

@Haemoffy

Posted

About your first question: there's a property called "background-blend-mode", this property works if you have "background-color" and "background-image" present or "background-image" or "background-color" with 2 or more values that you can blend in, Info regarding "background-blend-mode" https://www.w3schools.com/cssref/pr_background-blend-mode.asp or you could use a tutorial

Since you implement your image at the <img> tag itself, you wont achieve what was in the design,(i haven't tried this challenge myself so i could be wrong but from what im seeing, background-blend-mode might be the solution)

For your 2nd question: you're getting that kind of issue because of the width you applied to them, the width of the container or parent affects the children's width same goes to height. In your code, you gave your parent (the left-half class)or container a width of 50%, now that would also be your children(card-text class) default width, since you applied 70% width, so you're only accepting 70% of the total container's width thus the contents gotten compressed and some of the contents moved below that you did not want to

Removing the width will solve the issue and giving the padding: 50px to all direction will position them flawlessly without breaking the flow. Code version: .card-text { padding: 50px; text-align: left; }

Last question: You will eventually learn as it is required Watch this: https://www.youtube.com/watch?v=bn-DQCifeQQ This will teach you how to setup for creating mobile to desktop, it might be hard to wrap around in your head first but just take time and take it slow to understand and do some practices.

Recommend to learn: css reset box-sizing: border-box; instead of implementing <div> and set display: inline-block for most, use <span> instead, <span> is like div but difference is its default display is inline-block while <div> is block

for layout: flexbox (first) grid so you wont be using much float since it has drawbacks

bonus: ill give you a roadmap that I have follwed in my entire journey https://www.mediafire.com/file/0q0kg1watotme5j/2021+Frontend+Roadmap+-+Dark.pdf/file from web dev simplified but dont hesitate to watch other web dev youtubers like traversy, kevin powell

remember to take it slow, understand firmly, apply what you learn and put into practice, and take breaks damn i wrote too much

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