JavaScript is disabled! Please enable JavaScript in your web browser!

Freestyle Academy of Communication Arts & Technology

1299 Bryant Ave, Mt. View, CA 94040 T 650-940-4680   F 650-961-1346
2 Required Classes: English and Design 3rd/Elective Class:  + Animation or Digital Media or Film
Freestyle Logo

Font Size

+

-

Reset

Back to list of all examples

Useful Stuff About:

Background Image Centered AND FIXED

Scroll this browser window to see effect of background image that always centers itself and that does NOT scroll with content and is FIXED to the browser. Best practices:

Here's the CSS


body {
background-attachment:fixed;/*IMPORTANT to keep the image fixed to browser*/
background-image:url(../images/Background_Image_Centered.jpg);/*Adjust the path to actual image*/
background-repeat:no-repeat;/*Usually don't want custom background images repeating*/
background-position:top center;/*This ensures the top of the photo is always visible and it REMAINS centered on the page*/
background-color:#000;/*Adjust this color to fit the bottom most layer color or your main background image*/
}