Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Website Background CSS

Posted on 2012-03-24
8
Medium Priority
?
233 Views
Last Modified: 2012-03-25
Hey Experts I have a hopefully pretty easy one for ya.

I have attached my super simple site. So far I can't get the body to show the background in the images folder. It won't show up. I eventually want it to just repeat down the page and float in the center of the page on the x-axis.

First step is getting it to show up. Please tell me what I am missing!

-Jeff
Basic-Site.zip
0
Comment
Question by:jeffiepoo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 2
8 Comments
 
LVL 16

Assisted Solution

by:s8web
s8web earned 2000 total points
ID: 37762627
Removing the comma before repeat-y should do it.
0
 
LVL 16

Accepted Solution

by:
s8web earned 2000 total points
ID: 37762630
On second look, the path is wrong too.

With the current structure, make it look like this:

body {
  background: url(../images/Background.jpg) repeat-y;
  width: 800px;
  height: 800px;
}

Also, setting a width and height on the body like that is unusual and probably not what you want to do.
0
 
LVL 16

Expert Comment

by:s8web
ID: 37762637
In a css file, the location of the dependent files are relative to the css file, not the page.
0
Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

 
LVL 16

Assisted Solution

by:s8web
s8web earned 2000 total points
ID: 37762639
If you take your background image and crop it down so that it is 1px high, you will achieve the same look without the seam. The file will also be smaller.

I don't know if this page is intended for the public, but if it is, anyone with a display smaller than 1680x1050 isn't going to see the right side of your background.
0
 
LVL 6

Author Comment

by:jeffiepoo
ID: 37763075
Now what is wrong? I made the suggested changes.
Basic-Site.zip
0
 
LVL 16

Assisted Solution

by:s8web
s8web earned 2000 total points
ID: 37763134
Not much really. You have a good start. You will need to put the background on the body. The rest of the adjustments are to center everything appropriately.

/* reset browser styles */
html, body, h1, h2, h3, h4, h5, h6, p, ol, ul, li, pre, code, address, variable, form, fieldset, blockquote {
 padding: 0;
 margin: 0;
 font-size: 100%;
 font-weight: normal;
}
ol { 
  margin-left: 1.4em; 
  list-style: decimal; 
}
ul { 
  margin-left: 1.4em; 
  list-style:square; 
}
img {
  border: 0;
}
/* end reset browser styles */
body{
	background: url(../images/Background.jpg) top center repeat-y;
	text-align:center;
	}
#main {
  width: 950px;
  margin: 0 auto;
  text-align:left;
}

Open in new window

0
 
LVL 6

Author Comment

by:jeffiepoo
ID: 37763260
Why did the background not work inside of the div tag?
0
 
LVL 16

Assisted Solution

by:s8web
s8web earned 2000 total points
ID: 37763570
Well, actually it did. The reason you didn't see the background is because there was no content in the div. At that point the div was collapsed and not taking up any space. If you were to put the background image on that div, the background would not be displayed past the end of the content. By putting it on the body, it extends the entire height of the page regardless of content.
0

Featured Post

Plesk WordPress Toolkit

Plesk's WordPress Toolkit allows server administrators, resellers and customers to manage their WordPress instances, enabling a variety of development workflows for WordPress admins of all skill levels, from beginners to pros.

See why 2/3 of Plesk servers use it.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
The viewer will learn how to count occurrences of each item in an array.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

596 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question