I have a webpage with a fluid layout with a 100% width.
When I resize browser window the elements in the page overlap.
I would create an effect similar to this website http://bologna.bakeca.it/ that when window is smaller than a fixed width stop resizing.
min-width:100% makes sure the element is at least as wide as its container. width: auto allows the element to keep its original size.
The min-width property in CSS is used to set the minimum width of a specified element. The min-width property always overrides the width property whether followed before or after width in your declaration.
The width declaration will be set 90% of whatever it's container width is. The min-width makes it so that element has to be at least 600px wide. Thanks.
Definition and Usage The min-width property defines the minimum width of an element. If the content is smaller than the minimum width, the minimum width will be applied. If the content is larger than the minimum width, the min-width property has no effect.
You can set min-width property of CSS for body tag. Since this property is not supported by IE6, you can write like:
body{ min-width:1000px; /* Suppose you want minimum width of 1000px */ width: auto !important; /* Firefox will set width as auto */ width:1000px; /* As IE6 ignores !important it will set width as 1000px; */ }
Or:
body{ min-width:1000px; // Suppose you want minimum width of 1000px _width: expression( document.body.clientWidth > 1000 ? "1000px" : "auto" ); /* sets max-width for IE6 */ }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With