Why doesn't margin bottom work? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
14th May 2022, 10:46 AM
Lego in Motion
Lego in Motion - avatar
7 Answers
+ 2
// because random was not in the pic function function pick() { ran=Math.floor(Math.random()*5+0) //console.log(ran) document.getElementById("answer").innerHTML=answer[ran] }
14th May 2022, 11:07 AM
JaScript
JaScript - avatar
+ 2
What do you mean with margin bottom?
14th May 2022, 11:15 AM
JaScript
JaScript - avatar
+ 2
Lego in Motion There are 3 reasons why your margin bottom is not working. 1. Order of precedence. You have margin: auto after the margin-bottom. There for margin auto takes over. Simply change the order 2. margin bottom does not work because margin pushes outward from the element. Since there is nothing to push there is nothing to show. by adding another element below the button element you will see a space between the elements. Copy the button element to see it in action. 3. use px instead of %
14th May 2022, 6:47 PM
Chris Coder
Chris Coder - avatar
+ 1
Great! Thank you! But now I need an answer to my other question.
14th May 2022, 11:15 AM
Lego in Motion
Lego in Motion - avatar
+ 1
I don't understand your question. What do you want to achieve and with which elements? Can you describe specifically how you want your website to look?
14th May 2022, 2:15 PM
JaScript
JaScript - avatar
0
Oh also why doesn't it pick random every time you push the red button?
14th May 2022, 10:50 AM
Lego in Motion
Lego in Motion - avatar
0
Go to the bottom of css
14th May 2022, 11:23 AM
Lego in Motion
Lego in Motion - avatar