Design comparison
Solution retrospective
Hi Guys,
I have finished another project, I know the design and coding might seem really bootleg and noob but I am 100% self-taught, hence also open to any constructive criticism. My main questions which I could not figure out on my own and woul be very grateful if you could answer any of them are:
1.) There is a white border around the guy's profile pic which I could not recreate, any suggestions? 2.) I made the background in a -lets say- acceptable degree (compared to my skills) but is there any more "orthodox" way to create this kind of bakground? -meaning the image is turned by XY degrees and then the container is above them. 3.) Several elements use position:absolute with top/bottom/left/right XY% to put elements in the middle , I tried position:absolute and add 50% but for some reason then the picture totally was not positioned to the center, like .img_profile has top:25% and left:40% to put the guy's profile picture in the middle, this works. Any suggestions as to why 50% doesnt work as I would predict in this case?
Again, any constructive semantic/practice/method suggestion & criticism is very much appreciated in advance, so far I only have positive experiences with the community here in this regard. :)
Thanks in advance!
Community feedback
- @dusan-bPosted about 2 years ago
Hello Trezmor,
to create a white border around the avatar, you can simply add
outline: 3px solid #fff;
to the class of the image. You could also useborder
with the same values instead, but the advantage of theoutline
property is that it doesn't take up space. Feel free to try both techniques to see the difference.Regarding the background images, a better approach would be to specify them in CSS:
body { background: url("../images/bg-pattern-top.svg") top -300px left -50px/contain no-repeat, url("../images/bg-pattern-bottom.svg") bottom -350px right -50px/contain no-repeat; background-color: hsl(185deg, 75%, 39%); margin: 0; /* Remove the white space around body */ }
To make the effect visible, you need to remove both
div
elements containing the background images, and also remove thebackground-color
declaration from thecontainer
class.I hope it is clear enough. Keep it up!
Marked as helpful0 - @XxtbmfxXPosted about 2 years ago
Border: You could put the image in a div (by url) and then put something like
border: 5px solid white; because the image doesn't allow a round color border Background: you could put it out of the main container and use z-index property to change it somehow That's what i thought tell me if it helps you somehow :DMarked as helpful0@dknydPosted about 2 years agoHi Mate,
Thanks for the tip, the inclusion of the image in a div with white background and border solved the issue of the white circle around the profile pic! :)
1
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