I'm experimenting with a style that gradually expands a border up to 300px, and then uses text-overflow: ellipses when the limit is reached. If you're interested in seeing what I'm working on, feel free to click here to visit a JSFIDDLE demo.
I'd like the longest message text to be cut off at 300px and display an ellipsis. For shorter texts, I want the border to shrink to fit the size of the text. Any suggestions or assistance would be greatly appreciated.
.border{
background-color: #ffffff;
border: 3px solid #ffffff;
border-radius: 5px;
box-shadow: 0px 0px 10px #999999;
margin-left: 20px;
margin-top: 5px;
padding: 2px;
position: relative;
z-index: 4;
}
.border.small {
/* background-image: url('%Image(G3VISIF_EXP_BKGRD_SM)'); */
box-shadow: 1px 1px 10px #999999;
background-size: 100% 100%;
height: 22px;
width: auto;
}
.message {
color: #5c5d60;
font-family: Arial;
font-size: 17px;
font-weight: bold;
padding-left: 5px;
padding-top: 2px;
white-space: nowrap;
text-overflow: ellipsis;
max-width: 300px;
display: block;
overflow: hidden;
}
<div class="border small">
<div class="message">
Is [GRIDREC:EMPLID] Equals 123456789012345678901234567890
</div>
</div>
<div class="border small">
<div class="message">
Is Part Time
</div>
</div>
<div class="border small">
<div class="message">
Recieves Full Benefits
</div>
</div>