Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

resize based on browser window size. 1

Status
Not open for further replies.

Geates

Programmer
Aug 25, 2009
1,566
US
I'd like to resize my page depending on the window browser size. It would be cool to do it like but I'm only looking to resize the main content block.

Currently, the main content block (div) is set to a specific width 800px; If the browser window is resized to below 800px in width, the main content block should be resized to fully fit inside the browser.

It seems as though this could be easily accomplished by modifying document properties (eg [psudeo] document.content.width = browser.window.width) but I'm not sure how what event to trap and how to do it.

Any help is appreciated.

-Geates

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."
- Martin Golding

"There are seldom good technological solutions to behavioral problems."
- Ed Crowley, Exchange guru and technology curmudgeon
 
Looking at howtocreate.co.uk shows that they are giving their index (right hand div) a fixed width and floating it right. They then give their content div no fixed width, just a right margin the same size as the floating div.
Try using FF with the Firebug add-on so you can examine the various elements of a web page, including their css.

If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
I understand. Is there a css property that defines a minimum width?

-Geates

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."
- Martin Golding

"There are seldom good technological solutions to behavioral problems."
- Ed Crowley, Exchange guru and technology curmudgeon
 
Is there a css property that defines a minimum width?
Yes: min-width

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
thanks, vacunita

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."
- Martin Golding

"There are seldom good technological solutions to behavioral problems."
- Ed Crowley, Exchange guru and technology curmudgeon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top