I'm new to HTML, CSS, and trying make the fill the remaining space of it's container.
The problem is when the content of is too long, it will exceed out of the container, which make the break-word
not work (I think so)
This is my codes:
.a {
width: 50%;
height: 200px;
background-color: black;
display: flex;
}
.b {
height: 100px;
background-color: yellow;
display: flex;
}
.c {
background-color: gray;
margin-left: 20px;
color: blue;
height: 20px;
display: flex;
flex-grow: 1;
word-wrap: break-word;
}
<div class="a">
<div class="b">vcvxzc</div>
<div class="c">
<span> ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
</span>
</div>
</div>
When the span is not too long: enter image description here
When it's too long: enter image description here
how can I make it always contain inside the flex container. thank you so much