Welcome Guest [Log In] [Register]
We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
"Fix" the Background; background stays frozen while scrolling
Topic Started: Jul 28 2003, 01:24 PM (49,428 Views)
lightsup55
Member Avatar
Member
 *   *   *   *   *   *   *  
Admin CP ›› Skinning & Styles ›› Manage Style Sheets

To "fix" the background (the background stays frozen while scrolling), add the bold text:
Quote:
 
BODY { font-family: Verdana, Tahoma, Arial, sans-serif; font-size: 11px; color: #000000; margin:0px 10px 0px 10px; background-color:#FFFFFF; background-attachment: fixed }

This gives the background a "frozen" look.
Offline Profile Quote Post Goto Top
 
Deleted User
Deleted User

If you want to do it with a tiled background image, add this somewhere in the BODY line of the CSS:

Code:
 
background-image:url(the url for your image);


If you'd like to use a large image and have it not tile (repeat across the screen), you can do the following:

The code for making it not repeat is:

Code:
 
background-repeat: no-repeat;


The code for centering it would be:

Code:
 
background-position: center center;


Yes, that's 2 centers.
You can specify the position by percentage (X% Y%), by units (Xpx Ypx), or by keyword (top left, top center, top right, center left, center center, center right, bottom left, bottom center or bottom right)


You can add all those in one line like so:

Code:
 
BODY { font-family: Verdana, Tahoma, Arial, sans-serif; font-size: 11px; color: #000000; margin:0px 10px 0px 10px;
background-color: #ffffff; background-image: url(image url); background-repeat: no-repeat; background-position: center center; background-attachment:fixed }


Or you can put those all together in a shorthand version like so:

Code:
 
BODY { font-family: Verdana, Tahoma, Arial, sans-serif; font-size: 11px; color: #000000; margin:0px 10px 0px 10px;
background: #ffffff url(image url) no-repeat center center fixed }
Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Skinning Documentation · Next Topic »
Add Reply