+ 1

How to align a button beneath a gif?

I've some text, then a gif (treated as an image) and then a button. But the gif overlaps the button, so you can't see it anymore. How can I align it so that the button is a line under the gif instead of being covered by it? I looked through some solutions, one used block:inline in CSS, but my gif should be hidden in the beginning and only appear after an action. Everything is aligned centered.

21st May 2017, 7:54 PM
Maart
Maart - avatar
7 Réponses
+ 1
Ok. My solution is: 1. remove the position 'absolute' of the gif image. 2. add a style rule for the tryagain button like this: #tryagain { margin-left: auto; margin-right: auto; }
21st May 2017, 9:06 PM
Ulisses Cruz
Ulisses Cruz - avatar
+ 2
You can use the css solution like this: img#mygif { display: none; } then use javascript to change it after the action: function doAction(){ .... document.getElementById('mygif').style.display = 'block' }
21st May 2017, 8:09 PM
Ulisses Cruz
Ulisses Cruz - avatar
+ 2
https://code.sololearn.com/WdwSg2Um7KD2/?ref=app I'm talking about what happens when you run the program and click 'escape' on the first button. There should be a 'Try Again' button under the gif
21st May 2017, 8:39 PM
Maart
Maart - avatar
+ 1
Of course, let me see if it works!
21st May 2017, 8:10 PM
Maart
Maart - avatar
+ 1
@Ulisses Cruz Unfortunately, changing it to a block doesn't help. @Kainier ratsõ ._. If you need to see my code to give a solution, then I'll post it in
21st May 2017, 8:33 PM
Maart
Maart - avatar
+ 1
Yes, it works! Thank you so much!
22nd May 2017, 8:46 AM
Maart
Maart - avatar
0
Yes it would be better. If you put it in the code playground and then post a link to it here is even better.
21st May 2017, 8:36 PM
Ulisses Cruz
Ulisses Cruz - avatar