Currently working on a Reactjs project. I'm trying to set the height of the colorTab
div to match that of the content
div, while making it responsive. The height of content
should adapt dynamically based on the text content in title
and description
, which can vary in length, as well as the width of the window.
However, when I remove the min-height
property from the CSS of colorTab
and only use height: 100%;
, the colorTab
disappears. Adding back the min-height
makes it visible again but doesn't adjust to the height of content
, which is the main objective here. How can I solve this issue?
JSX:
<div className="wrapper">
<div className="colorTab" style={color}>
</div>
<div className="content">
<tr>
<td className="title">
<a href={link}>{title}</a>
</td>
</tr>
<tr>
<td className="description">
{description}
</td>
</tr>
</div>
</div>
CSS:
.wrapper {
min-height: 48px;
overflow: hidden;
}
.colorTab {
float: left;
position: relative;
width: 5px;
min-height: 48px;
height: 100%;
border-radius: 5px;
margin-left: 15px;
}
.title {
padding-top: 0 !important;
padding-bottom: 0 !important;
}
.description {
padding-top: 0 !important;
padding-bottom: 0 !important;
}