给父级元素加width: 0;
Document*{
margin: 0;
padding: 0;
}
#box {
width: 300px;
display: flex;
justify-content: space-between;
/* align-items: center; */
border: 1px solid red;
box-sizing: border-box;
line-height: 50px;
}
.left{
background-color: yellowgreen;
flex: 1;
// 父元素设置宽度为0
width: 0;
}
.text {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
height: 50px;
}
.right {
width: 100px;
/* height: 50px; */
background-color: #e4b9b9;
/* border-radius: 10px; */
}
内容内容内容内容内容内容内容内内容内容内容内容内容内容内容内容内容内容内容内容容内容内容内容内容
我在右边