1
I have the following HTML structure:
<div class="cloud_current_folder">
<div data-folder-name>My Cloud</div>
<div data-spliter></div>
<div data-folder-name>Documents</div>
</div>
And the following CSS:
.cloud_current_folder{
width:200px;
height:20px;
float:left;
position:relative;
top:30px;
background-color:#F00;
}
.cloud_current_folder div[data-folder-name]{
width:auto;
float:left;
line-height:20px;
font-size:16px;
font-weight:550;
color: rgba(19, 19, 19, 0.6);
overflow:hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
The size of cloud_current_folder
will be dynamic, that is to say 100%, but for the purpose of testing I put 200px
, when the size of the Divs containing the name of the current folder is greater than such value, such Divs are placed in new rows:
And I’d like to make that, the current size of the Divs data-folder-name
are readjusted and the text within them is cut, an effect like this:
In a way that no matter how many other Ivs are added, the current ones resize by making room for a new one. How could it be done?