I am trying to view a modal window. This window contains several spans. But they are limited by width and height. And when the size of the range is smaller than the span: everything is fine, I see this icon.
But when the text is large, I could not see this icon. And I had no ideas how to do this in pure CSS without using Javascript (jQuery).
HTML:
<div class="wrapper"> <span class="first">First</span> <br/> <span class="second">Second contain a lot of text. Really long span is here</span> </div>
CSS
.wrapper{ width: 300px; height: 500px; background: green; overflow: hidden; } span{ display: inline-block; width: 236px; height: 30px; line-height: 30px; font-size: 16px; padding: 0px; margin: 10px 20px; padding: 0 16px 0 8px; white-space: nowrap; overflow: hidden; background: #fc0; text-overflow: ellipsis; border: 1px solid green; border-radius: 4px; } span:hover{ border: 1px solid blue; cursor: pointer; } span:hover::after{ font: normal normal normal 12px FontAwesome; line-height: 30px; content: "\f040"; float: right; }
The first screen, the first interval: it is OK

Second screen, second range: this is not normal

Third screen, second range: it should be so

Any ideas? Also, the margin should be “user friendly” and the same in both cases.
Try it here:
http://codepen.io/anon/pen/KpMdvx
html css css3
brabertaser19
source share