I tried to display two inline elements. The first element is a normal element, and the second is an anchor tag. If the length of the anchor tag text exceeds the available space, I want it to wrap the next line, preferably without interrupting the word between them.
But I could not achieve the inline style when I tried to break the word.
The anchor simply moves on to the next line when the length of the text exceeds the current line. An example that I would like to show:
||| Hello Mannnnnnnnnn |||
||| nnnnnnnnnnnnnnnnnn |||
.parent {
// display : flex;
//display : inline;
}
.first {
display: inline;
}
.second {
display: inline;
max-width: fill-available;
word-wrap: break-word;
}
<div class="parent">
<div class="first">
Hello
</div>
<div class="second">
<a href="#">ManManManManManManManManManManManManManManManManManManManManManManManManManManManManManManManManManManManManManManManManManManManManManManManMan</a>
</div>
</div>`
Run codeHide resultAfter the encoding, there is a code
http://codepen.io/anon/pen/GqrJmo
I tried to make flexbox style, but it is even worse. After coding hasdisplay:flex
http://codepen.io/anon/pen/RRKPQr