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 6 of 6
  1. #1
    Junior Member
    Join Date
    Dec 2007
    Posts
    1
    Member #
    16239
    Hi,

    I'm trying to get an image to load as a background image using the following line of css;

    background-image:url(night.jpg);

    I've tried it in both the body selector and within one of my container ID's but it's not working.

    I'm using Mozilla Firefox on Ubuntu Linux. I've also tried it using Epiphany but it's not working. Am I doing something wrong?

  2.  

  3. #2
    Senior Member hyperair's Avatar
    Join Date
    May 2005
    Posts
    452
    Member #
    9892
    How about posting a link to the page in action? Or perhaps posting the code here? Don't forget that your night.jpg must be in the same folder as the HTML file importing that CSS file.
    Hyperair

  4. #3
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    I sometimes genuinely believe that the background attribute works when it wants to!

    1) Make sure your CSS validates
    2) If its in an external file make sure you are linking to it correctly.

  5. #4
    Senior Member kade119's Avatar
    Join Date
    Feb 2007
    Location
    USA
    Posts
    532
    Member #
    14888
    Liked
    1 times
    background-image:url("night.jpg");

    make sure you have quotations and same as above .. make sure linking to the correct directory..

    the bg attribute always works for me..

    i usually have separate folders for specific graphics/images

    background-image:url("graphics1/night.jpg");

  6. #5
    Senior Member hyperair's Avatar
    Join Date
    May 2005
    Posts
    452
    Member #
    9892
    Actually I did experiment before, a long time back, and found that the quotes don't matter. But url() must be there. It's of course better to put the quotes, but it doesn't make a difference in this context.
    Hyperair

  7. #6
    Senior Member Ferro's Avatar
    Join Date
    Oct 2006
    Location
    UK
    Posts
    386
    Member #
    14204
    Liked
    5 times
    Also if it's an external css file you are loading in, contained within "inc/css" then don't forget to put the "../../" before the target path.


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
  •  
All times are GMT -6. The time now is 11:21 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com