The moment div has the flex display property it stretches the paragraph. I seem to be missing something but no property I can think to put on the flex div chang
add another wrapper:
div {
display: flex;
justify-content: center;
flex-direction: column;
text-align:center;
height: 200px;
width: 100px;
}
p span{
background-color: green;
}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
Related question to understand why your inline is ignored:
Are flex items a block level element?
Usage of display property of flex box items