0

How to make the text inside the second column break to a new line after reaching the column's flex-basis and why is the right column's width increasing anyway considering I've set flex-basis to 100px?

.specific-image-flexbox {
    display: flex;
}
.specific-image-column {
    flex: 4;
    background-color: red;
}
.artwork-info-column {
    flex: 1;
    background-color: #f5f5f5;
    flex-grow: 0;
    flex-shrink: 0;
    flex-basis: 100px;
    padding: 15px;
    line-height: 1.8rem;
    background-color: blue;
}
<div class="specific-image-flexbox">
    <div class="specific-image-column">sssss</div>
    <div class="artwork-info-column">sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss</div>
</div>
Onyx
  • 5,186
  • 8
  • 39
  • 86

1 Answers1

1

Hope this help for you!

.specific-image-flexbox { display: flex; }
.specific-image-column {
    flex: 4;
    background-color: red;
}
.artwork-info-column {
    flex-grow: 0;
    flex-shrink: 0;
    flex-basis: 100px;
    padding: 15px;
    line-height: 1.8rem;
    background-color: blue;
    word-break: break-all;
}
<div class="specific-image-flexbox">
    <div class="specific-image-column">sssss</div>
    <div class="artwork-info-column">sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss</div>
</div>
Asiya Fatima
  • 1,388
  • 1
  • 10
  • 20