I have a group of div elements positioned absolutely on the screen.
If any div contains content that is too big for the screen, the browser wraps it into multiple lines to fit.
However, I do not want this behavior. Instead, I want the overflowing content to be hidden.
http://jsbin.com/welcome/35835/edit/
Edit:
Imagine a draggable div with absolute positioning on a page.
1) Users can move the div around the screen.
2) Users can adjust the width of the div manually (with a resize box widget).
The issue arises when dragging the div near the edges - the text should hide and not wrap outside the window.
Block 2 in the example demonstrates the desired outcome.
For instance, if the div's width is 100px and its left position CSS style is set to (screen width - 50), any overflow should be hidden.
Solution 1: Using white-space: nowrap doesn't work in this case due to the flexible width UI.
Solution 2: Explicitly setting the div's width to a specific number solves the problem.
However, this is not ideal as it requires calculating widths for all divs during rendering.
Is there a more efficient solution to prevent the browser from trying to fit text inside the screen?