Answer the question
In order to leave comments, you need to log in
Flex span auto width if line wraps?
If the span in flex wraps to the second line, the width becomes 100%, how do I set the width to auto?
Example :
<div>
<span>1234567890 1234</span>
</div>
div{
width: 100px;
height: 100px;
display: flex;
align-items: center;
justify-content: center;
background: red;
}
span{
background: green;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question