Design comparison
SolutionDesign
Community feedback
- @MelvinAguilarPosted almost 2 years ago
Hello there ๐. Good job on completing the challenge !
I have some feedback for you if you want to improve your code.
- You could update the CSS backgrounds properties to set the background:
body { background-color: var(--dark-cyan); background-image: url(../images/bg-pattern-top.svg), url(../images/bg-pattern-bottom.svg); /* background-repeat: no-repeat; */ /* object-fit: contain; */ background-repeat: no-repeat, no-repeat; background-position: right 52vw bottom 35vh, left 48vw top 52vh; /* background-position-x: left; */ /* background-size: 0.9rem; */ /* width: 100%; */ min-height: 100vh; /* margin: 0; */ /* padding: 0; */ /* overflow-x: hidden; */ }
background-color
Set the background colorbackground-image
Set a background imagebackground-repeat
Sets if a background image will be repeated along the horizontal and vertical axes, or not repeated at all.background-position
Sets the starting position of a background image. More information- You can also specify the size of the background image with background-size
The
background
property is shorthand for all the properties mentioned above but for now. It is better to understand them separately.The
background-position
for me worked with the vw (viewport width) and vh (viewport height) units, but you can also use percentages. It's just a matter of trial and error to place them as you wish.References:
To correctly center the component use a height to the main element:
main { min-height: 100vh; /* Add this*/ display: flex; justify-content: center; gap: 0; margin-top: 2rem; align-items: center; /* Add this*/ } .card { /* This is unnecessary */ /* margin-bottom: -90px; */ /* height: 60vh; */ }
I hope you find it useful! ๐
Happy coding!
Marked as helpful0
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