I have this React component where I want my .lower-display
to grow vertically as per the content entered by the user -
const Display = (props) => {
return(
<div className="display bg-dark">
<div className="upper-display">{props.sample}</div>
<div className="lower-display" id="display">{props.display}</div>
</div>
);
}
I have the following styles to applied to each of the div
elements -
.display{
width: 100%;
text-align: center;
color: white;
border: 1px solid white;
/* overflow: hidden; */
}
.upper-display{
min-height: 30px;
padding-right: 5px;
display: flex;
justify-content: flex-end;
align-items: center;
font-family: 'Orbitron', sans-serif;
font-weight: 400;
font-size: 16px;
color: orange;
}
.lower-display{
min-height: 35px;
padding-right: 5px;
display: flex;
justify-content: flex-end;
align-items: center;
font-family: 'Orbitron', sans-serif;
font-weight: 700;
font-size: 24px;
}
This doesn't give the results as expected. The content inside the .lower-display
starts overflowing horizontally.
I tried using word-wrap: break-word;
property, but it doesn't work either. How do I fix it?