I am working on a page, where I am displaying some html components (surprisingly :P).
The requirement is that the size of all these html components change according to how the browser window is being re-sized or how the client side resolution is.
For example, If have reduced the size of my browser window to half, how do I get the components to reduce to half, automatically.
Any pointers towards this would be helpful.
EDIT :
The need is for the components to remain in the same left to right order i.e. introduce horizontal scroll bar if needed.
Assuming you want to do this as easily as possible without JavaScript. In your css make sure the width and height attributes of anything you want to re-size are in percentages and not in pixels. Additionally if you need a child component re-size make that a percentage as well.
For example
If this is your html
Where the container div is the html component you want to auto resize
do this in your css
not this
By using the percentage in this example, say for instance your total browser width is initially 1000px; The container class div will display at 800px and the childContainer class will be 400px. If the user shrinks the browser to a width of 500px, the container class will shrink to 400px and the childContainer will shrink to 200px;
In other words the percentage width of any child container is based on the current with a parent container. If there is no parent container the percentage width is relative to the html body tag which is most cases is the width of the entire browser window.
Here is the markup based on your sample