Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 10 of 10

Thread: Background

  1. #1
    Senior Member
    Join Date
    Jan 2011
    Posts
    148
    Member #
    26229
    Liked
    1 times
    Hi I have designed a site in html and have a repeated background image which is working fine in my browser on my mac.

    There is a problem in that as soon as I compress the file to send to my client the background image doesn't show up.

    I added it in CSS and the image is still in the Images folder so I really can't understand this....

    can anyone help?

    CSS is below...

    html {
    background-image:url("Images/denim-background.gif");
    background-repeat:repeat;
    }

  2.  

  3. #2
    Member
    Join Date
    Jan 2011
    Location
    Edmonton, Alberta
    Posts
    82
    Member #
    26483
    Liked
    2 times
    Where is that CSS located? The file pathing for CSS is from where the CSS is. For example, if you have a CSS file in a folder called 'assets', then you would need to go back one in the file pathing to reach the images:

    background: url(../images/image.jpg);

    I would make sure the pathing is correct.

    As an aside, I always put the background image in the body tag, not the html. Also, you can combine the different background attributes into one line of code. For example:

    body {
    background: url(Images/denim-background.gif) repeat;
    }

    is the same as:

    body {
    background-image:url("Images/denim-background.gif");
    background-repeat:repeat;
    }
    Check out some of my work: http://www.jr-webdesigns.com

  4. #3
    Senior Member Harmonic's Avatar
    Join Date
    Jan 2011
    Location
    Toronto
    Posts
    291
    Member #
    26468
    Liked
    23 times
    check your pathing! I have a feeling that your image folder is called
    images
    not
    Images
    .

    Case sensitivity is important! I spent hours trying to figure out a similar problem years and years ago just to find that my images were linking to a folder called 'Img' but the folder was actually called 'img'.

  5. #4
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    Lose the quotes, too. you don't need them when referencing a background image.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  6. #5
    Senior Member Harmonic's Avatar
    Join Date
    Jan 2011
    Location
    Toronto
    Posts
    291
    Member #
    26468
    Liked
    23 times
    you may not need them TheGame, but i've used them in the past and it's never caused any problems..

  7. #6
    Senior Member
    Join Date
    Jan 2011
    Posts
    148
    Member #
    26229
    Liked
    1 times
    Thanks both for you help, will look into the CSS placing...

    The problem is that this all works in Textedit as I'm building the site, background is all good, it's just when I've zipped the file and sent on to people it's dropping off..

    I've also just found out that in Internet Explorer, specified text and placement aren't picked up so looks like it's not reading my CSS at all.

    Do you know why this is?

    My CSS is currently in the main folder, with the pages. Is that right? or do you recommend it being in a separate one?

    What I'm asking is I suppose, how do I ensure my CSS is picked up by all internet browsers?

  8. #7
    Senior Member Harmonic's Avatar
    Join Date
    Jan 2011
    Location
    Toronto
    Posts
    291
    Member #
    26468
    Liked
    23 times
    ... did you include the css file in your html file?

    <link rel="stylesheet" href="style.css" type="text/css">

  9. #8
    Member
    Join Date
    Jan 2011
    Location
    Edmonton, Alberta
    Posts
    82
    Member #
    26483
    Liked
    2 times
    I agree, the quotes are unnecessary when writing the reference for the image in the css:

    .class {
    background: url(../images/image.jpg);
    }
    Check out some of my work: http://www.jr-webdesigns.com

  10. #9
    Member
    Join Date
    Jan 2011
    Location
    Edmonton, Alberta
    Posts
    82
    Member #
    26483
    Liked
    2 times
    It doesn't matter where the CSS file is as long as you link it in your html page. Every page that needs to use the CSS must be linked. Harmonic's code to link the CSS is what you need to include. I personally put the CSS file into a folder called 'assets'. It's just how I've always done it, but you can do it any way you want.
    Check out some of my work: http://www.jr-webdesigns.com

  11. #10
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    I'd suggest uploading your site somewhere (not zipping it, but uploading it via FTP) so we can see what's going on. It's rather odd that one browser won't pick up a CSS file and another will.

    This sounds like a case of "something unrelated to the description of the problem is the problem."
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search tags for this page

repeating background image denim

Click on a term to search for related topics.
All times are GMT -6. The time now is 06:53 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com