Solved

Website Background CSS

Posted on 2012-03-24
8
226 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
  • 6
  • 2
8 Comments
 
LVL 16

Assisted Solution

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

Accepted Solution

by:
s8web earned 500 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
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 
LVL 16

Assisted Solution

by:s8web
s8web earned 500 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 500 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 500 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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Make a website not indexable by google 6 28
CSS Flex space-between 2 20
HTTPS for signup & login - HTTP for all other pages 10 46
Web page design problem 3 12
When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

740 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