AllExperts > Web Design 
Search      
Web Design
Volunteer
Answers to thousands of questions
 Home · More Web Design Questions · Answer Library  · Encyclopedia ·
More Web Design Answers
Question Library

Ask a question about Web Design
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Vishal Arora
Expertise
I've been learning web languages for approximately 10 years. I'm very well versed in proper, standards compliant HTML, XHTML and CSS. In addition, I also know ActionScript 2.0 and 3.0 for Flash projects and PHP for server-side applications. No Javascript questions please.

Experience
I run a successful web design and development firm in the US.

Education/Credentials
10 years practical experience in web technologies. 4 years experience running a successful web design/development firm.

 
   

You are here:  Experts > Computing/Technology > Web Design > Web Design > Adding a background image (css)

Web Design - Adding a background image (css)


Expert: Vishal Arora - 10/24/2008

Question
Hi,

I'm currently redesigning a website using a CSS template, but there is no background. How do i add one behind all the content?

Many thanks,

Graeme.

Answer
Hello Graeme,

To add a background to your page via CSS, you can use the following CSS style:

body {
 background-color:#FFF;
 background-image:url(relative/path/to/image);
 background-repeat:repeat;
 background-attachment:scroll;
 background-position:center center;
}

You can see a list of all of the options for all five of the background properties here:  http://www.w3schools.com/css/css_background.asp

Note that you can use the same styles on ANY element.  But adding the background to the body element adds a background to the entire page.

Add to this Answer   Ask a Question


 
User Agreement | Privacy Policy | Kids' Privacy Policy | Help
Copyright  © 2008 About, Inc. AllExperts, AllExperts.com, and About.com are registered trademarks of About, Inc. All rights reserved.