I have a variable width HTML layout with a fixed width menu to the left of the variable width <div> content (set css max-width and min-width). For very narrow browser windows, I would like the content to wrap under the menu, and currently I achieve this by setting float:left both the menu and the content.
<html> <head> <title></title> </head> <body> <div style="width: 200px; float: left; border: 1px black solid">Menu (200px wide)</div> <div style="max-width: 800px; min-width: 300px; float:left; border: 1px black solid">Content div. This div has max-width: 800px; min-width 300px. It has enough text that it expands to its max-width if there is space available to do so.</div> </body> </html>
In this example, the flow of the contents of the div is currently occurring as soon as the browser window is less than 1000 pixels (menu width + maximum content width). First, I would like to reduce the width of the content and wrap the content under the menu only if the viewport is less than 500 pixels wide (menu width + minimum content width)
Is there a way to achieve this, either with my current location of the floating <div> s, or else?
source share