Reply LinkBack Thread Tools Search this Thread
Old 16-06-2008, 18:13   #1 (permalink)
octavia
Registered User
 
Join Date: May 2008
Posts: 31
Can I set the size of the page (background based) on the size of the context "box"?

I decided to create my own web site from scratch that way I could also learn. I know a bit of HTML but I'm fairly new to CSS so I really screwed up the code cause I don't know what I'm doing. So basically I used a textured background image instead of a one-color background. Then I used a lighter area where the content should be.

I'm trying to set the size of each page (tapestry-like background) based on the size of the content box, and leave a space on the bottom over the dark image so I can add more info like contact, etc.

For instance, page1 has more text than page2. So page1 will be scrollable and page2 won't. See graphic:

img363.imageshack.us/img363/8263/contntxm1.jpg

Can I add a property to the css code to make the size of the page larger or smaller based on the size of the content box?
Code:
body { background-image: url('graphics/background.gif') } .navl{ position:absolute; background:#f1eeda; left: 15%; top:7%; width: 910px; bottom:7%; height: 700px; right: 15%; }
  Reply With Quote
Old 16-06-2008, 19:07   #2 (permalink)
pagey
Resident Cheese Expert
 
pagey's Avatar
 
Join Date: Aug 2006
Location: South Wales
Posts: 512
Hi there,

you don't actually need to give your content area any height specification. It will stretch as required depending on the content within it.

So you just need to specify width properties etc.

(Might be an idea to set the 'min-height' property of the document to 101% to stop the scrollbars disappearing (and the page jumping) in Firefox.
  Reply With Quote
Old 16-06-2008, 19:44   #3 (permalink)
octavia
Registered User
 
Join Date: May 2008
Posts: 31
Thank you pagey. The problem is that the content area goes all the way down to the bottom:

img112.imageshack.us/img112/5089/borderswl5.jpg

But if I remove 'height: 700px;', the lighter area decreases in size.

Quote:
Originally Posted by pagey
Hi there,

you don't actually need to give your content area any height specification. It will stretch as required depending on the content within it.

So you just need to specify width properties etc.

(Might be an idea to set the 'min-height' property of the document to 101% to stop the scrollbars disappearing (and the page jumping) in Firefox.
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8