I have a layout where there will be 6 Divs floated left to make 6 columns across. The 6th column will likely cause the total width of these floats to be wider than the window of most users. Is it possible for this 6th to be partially visible (anything wider than the window gets hidden), rather than the 6th column wrapping to a a new line below the others. Diagram below.
\
+----+ +----+ +----+ +----+ +----+ +--/
| 1 | | 2 | | 3 | | 4 | | 5 | | 6\
| | | | | | | | | | | /
| | | | | | | | | | | \ Screen Edge
| | | | | | | | | | | / <---
+----+ +----+ +----+ +----+ +----+ +--\
/
Sure, you can do it with the following markup and css:
HTML
CSS
You can see the result here.
The reason for the
#columnscontainer is to set overflow to hidden.#wrapthen makes sure the floats don’t drop if they don’t have enough space (even with overflow: hidden set, floats will drop if their parent container isn’t wide enough).