tags:

views:

82

answers:

3

Any idea why my web page content doesn't resize with the window?

I'm not using fixed position - just a table with width="100%". I've put it in a placeholder

+3  A: 

To make it resize with the window, your placeholder must have width:100% too.

Warrantica
and any containers that the placeholder is in must have a width set on them as well.
quoo
thats what i was thinking but there isn't an option to set the width for the asp:content control
insanepaul
`div` are automatically 100% width, so you don't need to set width for those. Check the generated html, insanepaul, and see what HTML elements are being generated. I suggest using firebug.
ANeves
ok i used firebug and noticed that the page container is 1000px and the content holder I'm working in is 650px. How would I set the contentholder to be 650px wide and also resizable so that my content inside will be resizable?
insanepaul
If it's a block-level element then you don't need to specify a width - it will always be 100% of the container. Remove fixed widths from your CSS and inline styles.
Dan Diplo
outside the container the content is resizable. The container is:<asp:Content ID="Content2" ContentPlaceHolderID="contentList" Runat="Server">The css:#contentList_content{ float:left; width:630px; height:100%; padding:0px 10px 0px 20px; border-right:solid 1px #cccccc;}
insanepaul
A: 

Did you set the padding and margin of the body to 0

the inline CSS rule would be

<style>
  body{
    padding:0;
    margin:0;
  }
 </style>

or on the body tag

<body style='padding=0;margin=0' >   
ggonsalv
If something is stopping the content from resizing with the window, then that won't help … and the HTML is invalid nonsense.
David Dorward
Thanks for noticing the mistyped body tag. By default browsers put padding and margin on all elements. Each browser puts in a different amount. Sometimes when maximizing the window it looks the table is not 'resizing' to the fit the window. Hence my solution.
ggonsalv
+1  A: 

The width is relative to its outer component. If the Placeholder is 500px the table take up 100% of the placeholder (500px) but no more.

Duncan