We help IT Professionals succeed at work.

make css boxes grow and shrink to resolution

bbimis asked
I know monitors are different resolution so how would I make sure that the content within the body tag is stretched accordingly?
I have a bunch of
<div> </div>

Open in new window

in a css and it works fine on my monitor at 1300X
but I'm afraid it will be messed up on lower resolutions.

is there a way to encapsulate the whole thing so its relative to the container?
 if so how thanks
Watch Question

Senior Network Systems Specialist
Add to the top of the web page this CSS code:

<style type="text/css">
Content { width=100%; }

Also check all tags for web items such as boxes, tables and so on  and make sure that any widths and heights are set using percentages rather than pixels so that they auto-resize if the window size changes.
Top Expert 2013

If everything is defaulted with no element level styling then the best approach would be:

<style type="text/css">
body { width=100%; }

However without a link to the page We have no way of knowing if the actual structure will be broken by a gross application.  Best practice is to deal with elements of the layout individually so there are no surprises.



aw so always use % .  good to know. I was using the <value>px method.