Design comparison
Solution retrospective
Can we change the color of the background image which was given as a svg format? because in the given design the background color was a little bit different, it got me a little bit confused.
Community feedback
- @emestabilloPosted about 2 years ago
Hey @omerkhan7210, the trick here is to push the svg to the top of the page with
background-position: top center
and then giving the bodybackground-color: var(--color-1)
. Other tips:- Use mobile-first when writing CSS. It's harder to scale down large elements to make them fit in smaller screens
- It's ideal to keep all styles inside your css file instead of placing them inside html. It was not necessary in this case.
- The document is missing an
h1
. Don't choose a heading tag based on how large the text appears in the design. Use classes to style the headings instead. Here's a resource - The link 'Change' should be an
a
orbutton
tag since it is an interactive element - The woman image is not expanding to match the width of the card in medium sized screens. Use
background-size: cover
Hope this helps!
Marked as helpful4@omerkhan7210Posted about 2 years agoHey @emestabillo Next time i will assure to write all the css on mobile screens first , then move on to larger screens. Yes the svg background part was a little confusing,will try it on later projects. The positioning of bg-image got a little bit weird. As for the button/anchor part i thought there wont be any interaction and i had given a font size to my p tags so i thought it would be okay to use it. Will definitely see through your resource. Thanks for the tips Ma'am.π
1 - @correlucasPosted about 2 years ago
πΎHello Omer, Congratulations on completing this challenge!
Hereβs some tips to improve your component design:
The SVG background is not properly applied, to fix that first you need to add
background-size: no-repeat
(to avoid it repeating) and then addbackground-size: contain
to make it fit full width and vertically aligned with the card.body { background-size: contain; background-image: url(img/pattern-background-desktop.svg); background-repeat: no-repeat; background-color: #ebf5ff; }
βοΈ I hope this helps you and happy coding!
Marked as helpful1@omerkhan7210Posted about 2 years agoHey @correlucas thanks for the tips sir ,later on will try to code better and accurate.ππ
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