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

PROFILE CARD USING HTML AND SCSS

@iamdrmeka

Desktop design screenshot for the Profile card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


What is the Best practice for adding the background images?

Community feedback

J Z 290

@half-cto

Posted

Hi Ijeoma, congrats on finishing this project!

I'm not sure what is best practice (and Your take works as well), but I can share mine.

main {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: #19A1AE;
    background-image: url(../images/bg-pattern-top.svg), url(../images/bg-pattern-bottom.svg);
    background-position: left 50vw top 45vh, right 50vw bottom 45vh;
    background-repeat: no-repeat;
}

I added both pictures to background and set positions. I like this solution since bg pictures are not interfering with flow of page. Hope this helps!!

Marked as helpful

0

@iamdrmeka

Posted

@half-cto

Can you help tell me how this positioning works?

As well as how it affects the two images?

0
J Z 290

@half-cto

Posted

@iamdrmeka

You can use background-image: with multiple images seperated by comma and then you can set background-position: for each image.

background-position: right 50vw bottom 45vh, left 50vw top 45vh;

this positions img1 50vw units from right side and 45vh from bottom, img2 50vw from left and 45vh from top. but you can use any css units for this positioning bacground-position

Since both pictures are set as background they don't interfere with other elements. Hope this clears it up, but let me know if you want some more clarification. Also here is link to my solution

Marked as helpful

2

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