(OLE)
So I had a problem. A long, unordered list of links seems to want to overflow out of their containing <div>. The list items were set to display inline and were extending out past the width of that <div> instead of wrapping down to a new “row”. This list was being generated programmatically, i.e. (simplified):
1 2 3 4 5 6 7 8 9 10 11 | $values = get_values(); $display = "<ul>"; foreach($values as $value) { $display .= "<li>$value</li>"; } $display .= "</ul>"; echo $display; |
Why was my list spilling out of its well defined boundaries? A staggering amount of time was spent fiddling with every possible CSS property for that element and those around it. Edit, save and reload. Edit save and reload. It was driving me insane.
Solution? Append a newline after each list element.
6 | $display .= "<li>$value</li>\n"; |
I have no idea why. If you do, please enlighten in the comments.
Dear Lord I hope this helps someone else out.
Comments are Okay