Notices
The Basement Non-Honda/Acura discussion. Content should be tasteful and "primetime" safe.

Page Background question

Thread Tools
 
Old Sep 13, 2009 | 09:01 AM
  #1  
DarkStarr's Avatar
DarkStarr
Thread Starter
Shake n Bake!
 
Joined: Feb 2006
Posts: 11,794
Likes: 1
From: Pittsburgh, PA
Default Page Background question

Anyone know how to make a page background take up a percentage of the screen? Like right now my forum is set at 80% but the bg image is fixed.. I'd like the background to be fluid with the forum.

Thanks in advance!
Reply
Old Sep 14, 2009 | 06:00 AM
  #2  
k3ifers's Avatar
k3ifers
k three ifers
 
Joined: Jun 2002
Posts: 42,568
Likes: 4
From: Buffalo, NY
Default

wat
Reply
Old Sep 14, 2009 | 06:05 AM
  #3  
BetterBob's Avatar
BetterBob
Nobama
 
Joined: Sep 2004
Posts: 6,961
Likes: 0
From: Sarasota, Florida
Default

Do you mean you want a faded image in the background? Like a watermark?

Or you want to manually set the size of the image?
Reply
Old Sep 14, 2009 | 07:18 AM
  #4  
ShaolinLueb's Avatar
ShaolinLueb
Senior Member
 
Joined: Jun 2002
Posts: 14,544
Likes: 0
From: Holyoke, MA
Default

sounds like he wants to manually do it.


good luck.....
Reply
Old Sep 14, 2009 | 07:29 AM
  #5  
DarkStarr's Avatar
DarkStarr
Thread Starter
Shake n Bake!
 
Joined: Feb 2006
Posts: 11,794
Likes: 1
From: Pittsburgh, PA
Default

no no, right now my forum takes up 80% of the window size, i wanted to know if there was a way to make my background also set to take up 80% of the screen size as well.. if that makes any sense. that way, the forum and bg image always match no matter what resolution a user has.
Reply
Old Sep 14, 2009 | 07:47 AM
  #6  
BetterBob's Avatar
BetterBob
Nobama
 
Joined: Sep 2004
Posts: 6,961
Likes: 0
From: Sarasota, Florida
Default

Hmmmmm...

Faking a Stretched Background Image Over a Smaller Space

You can use a similar technique to fake a stretched background image across a div or other element on your Web page. This is a bit trickier as you have to either use absolute positioning or have strange spacing issues for other parts of your page.
  1. Place the image on the page that I want to use as the background.
    <img src="bgimage.jpg" alt="background" id="bg" />
  2. In the style sheet, set a width and height for the image. Note, you can use percentages for width or height, but I find it easier to adjust with length values for the height.
    #bg {
    width:20em;
    height:30em;
    }
  3. Place your content in a div with the id "content" as above:
    <div id="content">All your content here</div>
  4. Style the content div to be the same width and height as the background image:
    #content {
    width: 20em;
    height: 30em;
    }
  5. Then position the content up the same height as the image. So if your image is 30em you would have a style of top: -30em; Don't forget to put a z-index of 1 on the content.
    #content {
    position: relative;
    top: -30em;
    z-index: 1;
    width: 20em;
    height: 30em;
    }
  6. Then add in a z-index of -1 for IE 6 users, as you did above:
    <!--[if IE 6]>
    <style type="text/css">
    #bg { z-index: -1; }
    </style>
    <![endif]-->
Be sure to test this in as many browsers as you can. And if your content changes size, you'll need to change the size of your container and background image, otherwise you'll end up with strange results.



Not sure if that helps at all. But it looked relevant.

Here's the link i got it from: http://webdesign.about.com/od/css3/f/blfaqbgsize.htm

The "how to" directly above the one i posted may be better for you

Last edited by BetterBob; Sep 14, 2009 at 07:57 AM.
Reply




All times are GMT -8. The time now is 01:40 PM.