My code is:
* {
margin: 0;
padding: 0;
}
aside {
background-color: green;
width: 20%;
display: inline-block;
}
main {
background-color: red;
width: 80%;
display: inline-block;
}
<aside>
<h2>aside</h2>
</aside>
<main>
<h1>main</h1>
</main>
I've set 20% width to aside
block and 80% to main
block, but they are not aligned horizontally as I expected. By changing aside
's width to 19%, it works. My question is why it doesn't work with 20% and 80%?