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:

see screenshot

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

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -