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, ie 100%, but for test purposes I put 200px
, when the size of the divs containing the current folder name are greater than this value, such divs are placed in new lines:
AndI'dliketocausethecurrentsizeofthe%divswithdata-folder-name
tobereadjusted,andthetextinsidethosebecut,aneffectlikethis:
In such a way that no matter how many other divs are added, the current ones are resized by making room for a new one. How could it be done?