2

I put direction:rtl; to show in reverse order, but I want to truncate extra text at right side, but not left side.

   .file-upload-status {
    border: 1px solid #ccc;
    white-space: nowrap;
    overflow: hidden;
    direction: rtl;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
<div class="file-upload-status" style="width:200px">
<span>*</span>
   <span></span> C:\fakepath\996571_1398802860346752_2094565473_n.jpg</span>
</div>

Can someone help me on this?

satish kumar V
  • 1,695
  • 6
  • 33
  • 47

2 Answers2

3

removing direction: rtl and adding below solves my problem

.file-upload-status {
   border: 1px solid #ccc;
   white-space: nowrap;
   overflow: hidden; 
   display : flex; 
   flex-direction : row-reverse; 
   align-items: flex-start;
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;

}

satish kumar V
  • 1,695
  • 6
  • 33
  • 47
1

Used text-align:right instead of direction:rtl

 <div class="file-upload-status" style="width:200px">
    <span class="star">*</span>
       <span> C:\fakepath\996571_1398802860346752_2094565473_n.jpg</span>
    </div>


 .file-upload-status {
     text-align:right;
    border: 1px solid #ccc;
    white-space: nowrap;
    overflow: hidden;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

}
.star{
float:right;
}

Fiddle: https://jsfiddle.net/mnevrs02/

DPS
  • 943
  • 11
  • 22