Why isn't my div background image visible?

Posted on 2011-10-26
Last Modified: 2012-05-12
I am developing a jquery slide show at   Since the images are large, and may take a few moments to load, I decided to use the first image as a backgound for the slide show div.  I thought that would fill the space until the dynamic elements have loaded.  To test this, I removed the slide show images from the div, expecting to see just the static backgdound image.  But it doesn't appear.  What is wrong?
Question by:ddantes
    LVL 20

    Accepted Solution

    Well its hard to test, even when I turn off JavaScript I still see an image (of course).

    If it's not working try adding quotes to your background-image:


    Honestly usually it works with and without the quotes.

    You may have quotes (its hard to tell). The tools Im using make it look as if you don't.

    If that doesn't work try using the fully qualified URL and see if that goes:

    If that works you need to adjust your relative pathing for this... probably to ../Rotator.jpg

    If you didn't have the height/width set I'd say the <div> was collapsing when you take out the images, but it appears you have this done.

    ..s'all I got, food for thought.

    Author Comment

    Thank you for your comment.  Adding quotes totally did it.  The designated image appears now, with all the div contents deleted.  Many thanks!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Course: CSS Specialist

    We don’t have to sell you on the idea of becoming a developer. If you’re you here, you already know it’s one of the most lucrative (and fastest growing) career tracks out there. It’s CSS that allows you to set yourself apart from other web and mobile developers.

    Unordered lists (HTML ul tags) are very handy to create menus of all types, shapes and sizes.  All it takes is a little knowledge of CSS and the possibilities are endless. First off, you should know the general format for menus created using the …
    Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
    In this Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…
    In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now