-1
Hello, I got this style sheet:
#contentor {
width:315px;
margin: 0 auto;
}
div.linha div {
width: 100px;
height: 100px;
margin:0px;
padding:0px;
border: 1px solid black;
display: inline-block;
font-size:32px;
text-align: center;
line-height: 100px;
}
h1 {
text-align: center;
}
And this script:
var corFundo = "red";
function mudarFundo00() {
c00.style.backgroundColor = corFundo;
corFundo = "yellow";
c00.innerHTML = "X";
}
var c00 = document.getElementById('c00');
c00.addEventListener('click', mudarFundo00);
Before you click I have this:
When I click I get this:
Can someone explain to me the reason for this displacement and how to leave the div at starting position?
Thank you very much!
Thanks matmartino! That’s right. Thank you
– Antonio