html - Ellipsis works in second span, but not in first one -
i´ve encountered strange behaviour ellipsis property. works 1 span element, doesn't work on another, identical span:
how possible? know how fix problem? appreciated.
here's html:
<div class="parent"> <span class="ellipsis">sadkljasjkfdhkjlhas-qdasfqewrwqe.pdf</span> <div class="icons-right"> <a href="#"><img src="edit-icon.gif"></a> <a href="#"><img src="delete-icon.gif"></a> </div> </div> <div class="parent"> <span class="ellipsis">terribly-terribly-long-filename.doc</span> <div class="icons-right"> <a href="#"><img src="edit-icon.gif"></a> <a href="#"><img src="delete-icon.gif"></a> </div> </div>
and css:
.parent{ height: 50px; padding-left: 15px; } .ellipsis{ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-top: 15px; display: block; } .icons-right{ position: relative; top: -25px; float: right; width: 62px; } *, *::before, *::after { box-sizing: border-box; }
does know how fix problem?
add margin-right: 62px;
.ellipsis
.
it because float: right; position: relative; top: -15px
.icons-right.
remove top: -15;
, see box model.
Comments
Post a Comment