In the below code, the element with the content is out of order with respect to the other elements without content. This doesn’t occur when all the elements in the row has some content in them. Any idea why this is happening? (Thanks in advance for the help).
<style>
button {
background-color: #ffff;
border: 1px solid #999;
width: 120px;
height: 120px;
margin-top: -1px;
margin-right: -1px;
font-size: 50px;
font-weight: bold;
}
</style>
<div>
<div>
<button> </button>
<button> </button>
<button> </button>
</div>
<div>
<button> </button>
<button> X </button>
<button> </button>
</div>
<div>
<button> </button>
<button> </button>
<button> </button>
</div>
</div>
2
Answers
Here is the solution:
you should add property vertical-align: top; to button styles: