Hi Team
I have a HTML code, but i notice aligning is not good, meaning Chose file is stretch far from left instead of center just like an image and want to align it well. Please assist me on improving this logic below so UI can look good.
Code
"
alt="Profile Image"
class="img-fluid rounded-circle mb-3"
style="width: 150px; height: 150px;">
Edit Profile Picture:
Save Image
.file-input {
display: inline-block;
max-width: 250px;
padding: 5px;
vertical-align: middle;
text-overflow: ellipsis;
}
.form-label {
margin-bottom: 0;
font-weight: 500;
margin-right: 10px;
vertical-align: middle;
white-space: nowrap;
}
.custom-file-input-wrapper input[type="file"] {
width: 100%;
text-align: right;
}
Jayraj ChhayaRank #304 · 8.2K reputationPosted Nov 28, 2024, 8:42 AM EST
Hi Gcobani Mkontwana,
To enhance the alignment of the "Choose file" input in your HTML code, you can modify the CSS styles and structure slightly. The goal is to ensure that the file input aligns well with the label and maintains a centered appearance.
Key Changes
justify-content: center;to the.d-flexclass to center the label and input together.