I have seen that making links a flex container can be useful when vertically/horizontally centering text within a link used in navigation elements. I didn't realise that the link text can actually be a (single) flex item. I can see that span elements within a link can be flex items. I would appreciate an explanation of why it is that the text of a link flex container is a flex item. For example is text in say a div flex container a single flex item - whether it be useful or not!?
I enclose a few examples that might help with comments.
a {
border: 2px red solid;
display: flex;
flex-direction: row;
height: 100px;
width: 250px;
justify-content: center;
align-items: center;
margin:10px;
}
a span {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}
a span:nth-child(1) {
font-size: 20px;
color: red;
}
a span:nth-child(2) {
font-size: 10px;
}
<a href="#">Hello World!</a>
<a href="#">Hello World! Lorem ipsum dolor sit amet consectetur adipisicing elit.</a>
<a href="#">Hello World! Lorem ipsum</br>dolor sit amet</br>consectetur adipisicing elit.</a>
<a href="#"><span>Hello World!</span><span>Good Bye!</span></a>
<a href="#"><span>Hello World! Lorem ipsum dolor</span><span>sit amet consectetur adipisicing elit.</span></a>