I have the following snippet. I want to render a little red triangle in the top-left of a cell if the input has the CSS class 'changed'.
It works for checkboxes, but not for text inputs. When I inspect the element in Chrome, the diamensions of the pseudo-element for a checkbox is 0 x 0
and for a text input it's auto x auto
so there is clearly some difference in the way the browser is handling these but I can't figure it out.
How can I change this so that it works the same for both? What is the mechanism responsible for the difference? Does one or the other have some implicit property that I could override? I am not interested in whether or not I should use this (I have already read this answer).
I'm using Chrome v75.0.3770.100.
td {
position: relative;
border: 1px solid black;
}
td input {
margin-left: 10px;
}
td .changed::after {
content: '';
position: absolute;
top: 0;
left: 0;
border-color: transparent;
border-style: solid;
border-width: 3px;
border-left-color: #c00000;
border-top-color: #c00000;
}
<table>
<tr>
<td><input type="checkbox" class="changed"/></td>
<td><input type="text" class="changed"/></td>
</tr>
</table>