Position absolute and relative

Solution retrospective
- At one point i had both a horizontal and vertical scroll bars , i used overflow hidden on the body but the horizontal scroll bar came up again ( when i checked on responsive mode on Mozzilla ) , any ideas ?
- Any suggestions about my code , how to make it cleaner , more semantic , better basically
Please log in to post a comment
Log in with GitHubCommunity feedback
- @yishak621
Good try but the main point of these project is practice the svg background adjustment and i know it seems hard but here is how the magic is done you will put the bottom svg out of the screen by absolute positioning and the top svg in the middle of the screen . And translate both of them to the left -50% and to the top -50% here is the full detail
/*Containers*/ .container { display: flex; min-height: 100vh; flex-direction: column; justify-content: center; align-items: center; position: relative; overflow: hidden; background: var(--color-one); z-index: -1; }
/*psuedo elments*/ .container:before, .container:after { position: absolute; content: ''; width: 100vw; height: 100vh; background-size: auto; transform: translate(-50%, -50%); /*to the left and top*/ z-index: -1; }
/*adding the top svg before the container*/ .container:before { top: 0; left: 0; background: url('/images/bg-pattern-top.svg') no-repeat bottom right; /*to expand to bottom and right*/ }
/*adding the top svg after the container*/ .container:after { top: 100%; left: 100%; background: url('./images/bg-pattern-bottom.svg') no-repeat top left; /*to expand to top and left*/ }
- @afaiz-space
Hey @Souheib-Aloui
- background circle image used in the body element with the help of background-image property use
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