954,598 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Style Sheet + background

Hi i use Style Sheets in every site i design, but i have noticed that most of the time my background image never shows up and i end up using an html code. Can someone check my code over for me. If someone can show me another way to write the code and it works every time i will mark as solved. If not... and some one can explain why it does not work everytime i will mark as solved.
background: url(structure_folder/i_background.png) no-repeat;
background-size: 100%;

The problem i might be having is that i always put the background images in a folder called structure_folder.

thanks,

P.S cant beleave im having problems with something so small.

stevenpetersen
Junior Poster
134 posts since Jun 2009
Reputation Points: 45
Solved Threads: 1
 

Hi Steven,

There are a couple of possibilities that could be causing the problem:
I find if I'm not adding values to the background, e.g. no repeat, hex colour, etc. that sometimes I have to use background-image rather than background...but that doesn't look like the problem here.
You may need to use absolute paths rather than relative, see below:
// Relative Path
background: url(structure_folder/i_background.png) no-repeat;
background-size: 100%;

// Absolute Path
background: url(/structure_folder/i_background.png) no-repeat;
background-size: 100%;


It's sounds silly but also make sure you have put this in the body and opened and closed everything correctly {} and used a semi-colon at the end of every line:

body {
background: url(/structure_folder/i_background.png) no-repeat;
background-size: 100%;
}


Not too sure if this solves your issues but hope it helps =D

laura_ci
Junior Poster in Training
73 posts since Jun 2009
Reputation Points: 10
Solved Threads: 5
 

background: url(structure_folder/i_background.png) no-repeat;
background-size: 100%;

- usually, i put the image path in quotes. Have you tried that yet ? I would try: background-image: url("structure_folder/i_background.png");
background-repeat: no-repeat;
background-size: 100%;

wilch
Junior Poster in Training
84 posts since Aug 2007
Reputation Points: 25
Solved Threads: 17
 

Hi every one, Can some one please explain / teach me how to use CSS to design a wonder and nice web page / site.
I don't have any understanding for it at all. So can some one help out please.

Thank you

abuscogreat
Newbie Poster
1 post since Aug 2009
Reputation Points: 10
Solved Threads: 0
 

Well, for one the niceness of the design comes from the design itself. CSS merely helps in keeping your html code clean - rather than mixing it with some extra html code for presentation.
The best source to begin with in almost any topic for an explicit intro. is wwwDOTw3schoolsDOTcom/css - Try it, then come back here for problems ;)

wilch
Junior Poster in Training
84 posts since Aug 2007
Reputation Points: 25
Solved Threads: 17
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You