I have two divs that I want inline (one on left, one on right). The one on right contains a line of text. I want it to always be a single line of text, and ellipsize when necessary. I must not be doing the inlining correctly, because when my text is too long, the right div jumps below the left one. Example:
<!doctype>
<html>
<head>
<style type="text/css">
#panelLeft {
display: inline-block;
width: 50px;
height: 20px;
background-color: #f00;
}
#panelRight {
display: inline-block;
background-color: #0f0;
/* width: 200px; */ works ok if explicitly sized
}
#test {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
</head>
<body>
<div id="panelLeft">
</div>
<div id="panelRight">
<div id="test">
This is some text that's longer than usual and that I'd like to have ellipsized, and forced to a single line, always.
</div>
</div>
</body>
</html>
If instead I specify a width for panelRight (which is equal to or shorter than remaining space), then my divs are on the same line, and ellipsizing appears correctly. How can I get this to work when I don't know the exact width panelRight will be?
Thanks