After hours of searching for a solution to my problem, I still couldn't find it. My goal is to align four divs inside a main div. The main div should have a width of 100%, and each inner div should be 25% of the main div in order to have all four divs of equal width in a single row. Here's the code snippet I've been working on:
html {
margin: 0;
padding: 0;
width: 100%;
}
body {
margin: 0;
padding: 0;
width: 100%;
}
.container {
margin: 0;
padding: 0;
width: 100%;
display: block;
}
.inner-div {
display: inline-block;
width: 25%;
}
.yellow {
background-color: yellow;
}
.blue {
background-color: blue;
}
.red {
background-color: red;
}
.green {
background-color: green;
}
<div class="container">
<div class="inner-div yellow">
yellow
</div>
<div class="inner-div blue">
blue
</div>
<div class="inner-div red">
red
</div>
<div class="inner-div green">
green
</div>
</div>
To my surprise, the last div doesn't seem to fit on the same row as the others. I'm puzzled by this issue! Can anyone offer some assistance?