When I changed the white space to nowrap, the width of the text became too wide. My goal is to have the text finish on one line only and end with ... when the width is reached. But for some reason, it pushes the width out instead. It seems like the widths are not being obeyed properly. While setting a max-width works, it doesn't make the design fluidly responsive which doesn't feel like the right approach.
Any suggestions or ideas? Thanks in advance for any help. An explanation of what is happening here would be very helpful!
* {box-sizing:border-box;}
.listingItem {
background: #f0f0f0;
margin: 10px 0;
padding: 10px 20px;
float: left;
position: relative;
}
.listingItemData {
float: left;
width: 100%;
}
.listingDisplayLeft {
width: 35%;
float: left;
padding-right: 20px;
}
.listingDisplayRight {
width: 65%;
float: left;
}
.listingItemText {
float: left;
overflow: hidden;
width: 100%;
}
.listingItemTextDetails {
background: pink;
width: 100%;
float: left;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.listingItemText .listingItemTextButton {
background: #375db5;
color: #fff !important;
padding: 10px;
border-radius: 5px;
margin-top: 10px;
float: left;
display: block;
font-size: 17px !important;
}
<div class="listingItem">
<input type="hidden" class="listingItemData" value="32142|32142|t|f">
<div class="listingItemData">
<div class="listingDisplayLeft"><a href="/listings/lost-pets/view/32142/test-tiger-demo/" title="View full details"><img src="http://assets.worldwildlife.org/photos/907/images/story_full_width/sumatran-tiger-hero_92514619.jpg?1345581518" style="width:100%;max-width:1024px" alt=""></a></div>
<div class="listingDisplayRight">
<div class="listingItemText">
<h3>
<a href="/listings/lost-pets/view/32142/test-tiger-demo/" title="View full details">test tiger demo</a>
</h3>
<div class="listingItemTextDetails">
i lost my pet tiger. i lost my pet tiger. i lost my pet tiger. i lost my pet tiger. i lost my pet tiger. i lost my pet tiger. i lost my pet tiger. i lost my pet tiger. i lost my pet tiger. i lost my pet tiger.
<br>
<br>i lost my pet tiger. i lost my pet tiger. i lost my pet tiger. i lost my pet tiger. i lost my pet tiger.
</div>
<a class="listingItemTextButton" href="/listings/lost-pets/view/32142/test-tiger-demo/" title="View full details">More information</a>
</div>
</div>
</div>
</div>