Design comparison
SolutionDesign
Community feedback
- @chegxPosted about 2 years ago
You can center img without positioning. Put the background image into main so it will act like background and won't interact with img. I commented your old code that you should remove.
main { background-image: url(images/bg-pattern-card.svg); background-repeat: repeat-x; } /* main .header { background-image: url(images/bg-pattern-card.svg); width: 100%; height: 157px; */ main .body { text-align: center; /* position: relative; */ } main .body img { /* position: absolute; */ border-radius: 50%; border: 5px solid white; /* left: 50%; top: -51px; transform: translate(-50%); */ margin-top: 90px; }
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