Jump to content
Stef's Coding Community
dina

my background doesn't want to repeat-y

Recommended Posts

my background doesn't want to repeat-y, but it does go x. Did someone ever experience this before, and what did you do to fix it.

 

Thanx

Share this post


Link to post
Share on other sites

body {

margin: 0;

text-align: center;

font: 0.8em verdana, arial, sans-serif;

line-height: 170%;

color: #FFF;

background: #585858 url(bg2_bady.jpg) repeat-y;

}

 

is this the test site?

 

anyway, my background doesn't want to show at all with this code, only the color gray, and if it take the color away I only sit with a white page.

 

thank you.

Share this post


Link to post
Share on other sites

There's nothing wrong with that code. The image file bg2_bady.jpg needs to be in the same folder/directory as your html file.

 

We need to see all your code and styles because the problem may be somewhere else; for instance a background in another element covering up the body background.

Share this post


Link to post
Share on other sites

Yeah, that's what I thought at first, but didn't dina say in her original post that the background image repeats across?

 

Still, I'm with Wickham here, as we really need to see a live example of this problem, so that hopefully we can find some simple solution to your problem.

Share this post


Link to post
Share on other sites

I just tested this, and it should be fine -- it worked correctly when I added my own image, repeating down the y axis, and also across the x axis when I changed the CSS. Is the "bg2_bady.jpg" image spelled correctly? Do the file names in both the actual JPG file and in the CSS match? And the image is in your wamp's www directory?

 

One other comment... In your CSS, the hash symbol "#" indicates that you are referencing a id, rather than a class. However, you don't need that hash symbol in your HTML. You should be using:

 

Share this post


Link to post
Share on other sites

Folder structure is important too. Your images should be in their own folder on root level. And really so should your style sheets. When you open the www dir folder you should see all of your pages html/php a folder for images and a folder for styles.

 

That being said you'll need to update your links to reflect the new structure. Like your

link to the style sheet and all of your images will need updated as well.

 

Thats a good practice. It will help in the long run to be organized.

 

I'm not sure about php... But in html it is not neccessary to add the pound sign (#) in the div value.

 

i.e.


 

should be


 

You still need it in the style sheet. Thats how it is identified as an id(#) or a class(.)

Share this post


Link to post
Share on other sites

Another thing: make sure that the image filename is lower case; the case must be the same in the code as in the actual filename.

 

and these lines

 

meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />

biPolar

 

have /> as the closing tag which is correct for XHTML but you have a HTML doctype so the lines should be:-

 

meta http-equiv="content-type" content="text/html; charset=iso-8859-1">

biPolar

Share this post


Link to post
Share on other sites

just want to thank all of you for your quick responds, I was really astound by that. I went through all the steps given, and finally managed to get to the problem, and that will obviously lead to my next Q.

 

Thanx!!!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...