Hey guys this was my first attempt with learning html/css at this and while i think it went well there were a few parts i struggles with. First, when i added a width to the "you scored higher div" it took it out of the align center and i wasnt sure why that was happening or what a clean fix was. Second, to try and get the right side to be overlapped by the left i was trying to set the z-index of it to -1, however when i did that the button stopped working even when i set the button to z-index of 1. Feedback and comments are most welcome!
Matthias K
@Matthew7991All comments
- @NefariousApeSubmitted over 1 year ago@Matthew7991Posted over 1 year ago
Hey congrats, while I'm also just a beginner i will try to answer your questions at least :D
- The text itself is still centered. But since you limited the width you have to center the element not just the text.
You could do this by either using
.paragraph {align-self: center}
as you did with the circle container.Alternatively you can use
.left-container {align-items: center)
on the parent container instead since you want all items centered anyway.Last option would be to use
.paragraph {margin: 0 auto}
which distributes any free space to the left and right of the element equally, but since you already use flex it would make sense to stick with the first two.- Regarding the z-index. Since you set the index of the right container to -1 it will be behind the .container which you can see if you give it a background color.
Because z-index has to be seen relative to it's parent and siblings and the button is a child of the .right-container it giving it a z-index of 1 only puts it above it's parent or other siblings but since the parent itself is behind something it won't change anything.
Though that said it don't understand why you want to set a z-index in the first place if it's for the background color. you could give .container the background color and then give the body a flex and height instead.
Hope it helped :D
0