I am working on react to display some images at the top with labels, and when I click on any of the I mage I want to show a border-bottom.
I am successfully doing this but the issue with the styling CSS
When I am showing css it is not showing at the bottom but at all image bottom it is showing up, which is breaking the alignment
I am using bootstrap for better UI
My code
<div className="App">
<div className="form-inline">
{d.map((li, index) => (
<div key={li.name} onClick={() => img_click_handler(index)}>
<img src={li.url} alt={li.name} className="image_class" />
<div className="label_name text-left">{li.name}</div>
<div className={index === index_id ? "test" : ""} />
</div>
))}
</div>
</div>
CSS
.App {
min-height: 17.6vh;
background: #ffffff 0% 0% no-repeat padding-box;
box-shadow: 0px 3px 10px #00000040;
opacity: 1;
}
.image_class {
height: 7vh;
width: 4vw;
margin-right: 5rem;
}
.label_name {
padding-top: 1rem;
width: min-content;
}
.test {
border-bottom: 4px solid gray;
background-color: red;
}
Issue
The issue is the border bottom I want to show to the end of the bar div but it is showing up to image bottom
Please check this Code sandbox for working example
** I want border bottom should come to the ending of the bar I don't know what I am doing wrong**