I have a this kind of parent div element (display: flex) containing two children elements
- Text – a span element
- (i) Icon – a div element
When the text is only one line (not wrapped) everything is ok.
however, when it is wrapped (2+ lines) the width of the element is according the the most wide line
I do want the text to be wrapped when it’s long.
In the above example, i would like the (i) icon next to the NORTH.
I would like the (i) icon next to the NORTH.
2
Answers
It sounds like you want the icon to behave as if it were inside the
span
element. Is there a reason not to put it there? Perhaps simply as an inlineimg
not enclosed in adiv
?If you simply want the icon to always be next to the word "North", just put it inside the span: