I am having problem aligning div elements in a table cell. Specially when the div element contains content in the CSS. It seems the div containing content drops below the other divs for a reason that I could not figure out, as shown in the image below. I have created a minimum example of the problem where I want the green div to align vertically with the other two divs inside the td element.
tr {
height: 30px;
}
td {
width: 100px
}
.l1 {
height: 30px;
width: 10px;
background: blue;
display: inline-block;
}
.l2 {
height: 30px;
width: 10px;
background: red;
display: inline-block;
}
.toggle {
height: 30px;
width: 20px;
background: green;
display: inline-block;
}
.toggle:before {
content: "\229F";
}
<body>
<div class="container">
<table>
<tr>
<td class="level2">
<div class="l1"></div>
<div class="l2"></div>
<div class="toggle"></div>
</td>
<td>Task 1</td>
</tr>
</table>
</div>
</body>