I have an erb block that prints a list with two elements, a .list-number
and an .list-item
, and I'm inserting ...<br>
after every .list-item
. I want the list to display like so:
1. Item1...
2. Item2...
3. Really long
item3...
4. Really really
really long
item4...
5. Item5...
But I'm having trouble with the display
aspect. If I use display:inline-block
like this:
//CSS
.list-number {position: relative; display: inline-block;)
.list-item {position: relative; max-width: 40px; display: inline-block;)
then the list prints like this:
1. Item1...
2. Item2...
Really long
3. item3...
Really really
really long
4. item4...
5. Item5...
so the divs that extend past their limits expand upwards. And if I just replace display:inline-block
with display:inline
, then the max-width
is ignored and the list-item
just keeps going, like this:
1. Item1...
2. Item2...
3. Really long item3...
4. Really really really long item4...
5. Item5...
How can I get .list-item
to be constrained by its max-width
, but also expand downwards? I made a fiddle to illustrate the problem: http://jsfiddle.net/1ex75zvs/1/