In need of assistance with aligning icons to the right of three input fields, each with different widths. Currently, the icons are aligned to the right of the parent container instead of the individual input fields.
If you're unsure what I mean, check out this example on CodePen for a visual representation.
.input-container {
width: fit-content;
position: relative;
margin-top: 16px;
}
.input-field {
padding: 8px 12px;
border: 1px solid gray;
position: relative;
}
.input-field.short {
width: 100px;
}
.input-field.medium {
width: 200px;
}
.input-field.long {
width: 400px;
}
.icon {
position: absolute;
right: 8px;
top: 8px;
}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b5d3dafbcfd4c2c0d6dac8da9dd49cd4d7d7e58687b888dad98e981">[email protected]</a>/css/fontawesome.min.css" integrity="sha384-jLKHWM3JRmfMU0A5x5AkjWkw/EYfGUAGagvnfryNV3F9VqM98XiIH7VBGVoxVSc7" crossorigin="anonymous">
<div class="input-container">
<input class="input-field short" type="text">
<i class="fa fa-user icon"></i>
<div>
<div class="input-container">
<input class="input-field medium" type="text">
<i class="fa fa-user icon"></i>
<div>
<div class="input-container">
<input class="input-field long" type="text">
<i class="fa fa-user icon"></i>