• 0

[CSS] Background image issue?


Question

I am having an issue getting a Background image to load properly.

I am using the following code.

background-image:url('url(/images/grade.gif');

Yet the image is not displayed.

Here is the file location table

Main Directory

  • CSS
  • images
  • parts

The parts of the page are located in the parts folder (head, preContent, and rightNav)

The Compiler PHP page is located in the main directory (index.php)

The image is located in the images folder.

I have checked to make sure that the capitalization is accurate however, it will not display the image background.

I have also attempted to browse to the image using URL/images/grade.gif and i am able to see it.

and before you ask No you cannot view the page because it is on an Internal Intranet and not accessible from outside the company.

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Um why do you have an extra 'url' and bracket in your code. shouldnt it be background-image:url('/images/grade.gif');?

Yup. Look at my code

background-image:url('header.png');

Oooooh the second 'url' is truncated by you. Fair enough but make sure your brackets are correct

Link to comment
Share on other sites

  • 0

Well your css there is just wrong o_0 url followed by another url ? Also single quotes are not needed.

background:url(/images/grade.gif);

Try that.

Link to comment
Share on other sites

  • 0

background-image: url('/images/grade.jpg');

That will work :)

1) Quotes are not needed, buit a nice practice in case of poor folder/file naming.

2) The first / is to make sure we are referencing off the root directory

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.