Grow your CSS skills. Land your dream job.

NEED HELP! Image Not Showing??

  • # December 17, 2011 at 1:26 pm

    hello,
    i have several html pages and one external css plus javascript for menu i am adding background img in external css but is not showing it on the website can someone figure out the issue and let me know,

    [CODE DELETED – please only post code specific to your problem]

    # December 17, 2011 at 1:34 pm

    1) Only post the relevant CSS

    2) Without a link to the live site, it’ll be hard to discern

    3) I can nearly 99% guarantee that it has something to do with the path to the image that you’ve entered.

    # December 17, 2011 at 1:41 pm

    hello,
    thanks, what about

    background-image:url(labandastgah/red.png); labandastgah being a folder in a directory which contains the image red.png
    can you be more specific thanks.

    # December 19, 2011 at 1:43 pm

    I’m saying that the path that you are using isn’t the actual path to the image.

    Where is your CSS file located (what is the path) and where is your image located (what is the path)?

    /images/red.png
    images/red.png
    ../images/red.png
    ../../images/red.png

    Those are all targeting different folders on the same server, so it’s important to know how they work.

    /images – targets a folder of ‘images’ in the root
    images – targets a folder of ‘images’ in the same location as the CSS file
    ../images – targets a folder of ‘images’ one level up
    ../../images – targets a folder of ‘images’ two levels up

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".