+ 1
(Solved) How can i make my mountain img to go 20px below my top-container?
I tried using margin bottom in negative value as well as the z-index property but unfortunately it's not working for me...need help https://code.sololearn.com/Wp46S4w7ny33/?ref=app
7 Respostas
+ 2
I didn't understand the question. You want to move mountain down by 20px? If so:
.mountain{
/*other css properties*/
position: relative;
top:20px;
}
Is this the effect you wanted?
+ 1
Absolute removes the element from the tree, so it becomes relative to the screen.
Then top:20px means image will be put at the top of the screen and then moved down by 20px.
Relative just offsets the element from where it would be normally.
0
BlazingMagpie Yes! It worked. Thank you so much.
0
But why it wasn't working with position absolute may I know the reason?
0
I got it now. Thanks once again
0
Hi
0
Hi