我有一个类似以下图片的div结构。
在较小的窗口中,我需要对此div结构中的文本应用"text-overflow: ellipsis;"。
但它没有按照我的期望应用。这是我的HTML代码。
这段代码有什么问题?能否给我指导一下?谢谢。
![image 1](https://istack.dev59.com/B1Avk.webp)
![image 2](https://istack.dev59.com/wNrAB.webp)
.header {
height: 60px;
width: 100%;
}
.header > .header_middle {
margin: 0 auto;
width: 100%;
}
.header > .header_middle.share-file-header > .caption {
float: left !important;
line-height: 60px;
overflow: hidden;
padding-right: 0 !important;
text-overflow: ellipsis;
white-space: nowrap;
padding: 0 30px;
}
.header > .header_middle.share-file-header .settings {
line-height: inherit;
padding: 0 15px 0 0;
float: right;
height: 60px;
position: relative;
}
.shared-person-detail-wrapper {
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
line-height: inherit;
}
.settings .share-files-msg, .settings .shared-person {
display: block;
font-size: 14px;
text-overflow: ellipsis;
}
.settings .more-persons-wraper {
display: inline-block;
position: relative;
}
<div class="header">
<div class="header_middle share-file-header">
<div class="caption">
<p>
<a href="/">
<img src="/resources/Image1.png" alt="Image 1" title="Image 1">
</a>
</p>
</div>
<div class="settings">
<div class="shared-person-detail-wrapper">
<div class="shared-person">
User Name <a href="mailto:user@email.com">(user@email.com)</a>
</div>
<div class="share-files-msg">
has shared file(s) with you
<div class="more-persons-wraper">and some <a href="#" data-toggle="dropdown" id="more">more</a> people.
<ul class="dropdown-menu pull-right" id="more-persons">
<li>user1@email.com</li>
</ul>
</div>
</div>
</div>
<div class="share-icon"><img src="/resources/Image2.png" alt="Image 2" title="Image 2"></div>
</div>
</div>
</div>