Geoffrey B. Veteran Posted September 23, 2010 Veteran Share Posted September 23, 2010 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 More sharing options...
0 MarkusDarkus Posted September 23, 2010 Share Posted September 23, 2010 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 More sharing options...
0 Ryoken Posted September 23, 2010 Share Posted September 23, 2010 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 More sharing options...
0 sweetsam Posted September 23, 2010 Share Posted September 23, 2010 According to what you have said it should be background-image: url(../images/grade.gif); Link to comment Share on other sites More sharing options...
0 +Dick Montage Subscriber² Posted September 23, 2010 Subscriber² Share Posted September 23, 2010 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 More sharing options...
0 Geoffrey B. Veteran Posted September 23, 2010 Author Veteran Share Posted September 23, 2010 Thanks Got it working now :D Link to comment Share on other sites More sharing options...
0 +Dick Montage Subscriber² Posted September 23, 2010 Subscriber² Share Posted September 23, 2010 Guessing your issue was more a "oops I copied and pasted wrong" more than anything? :) Link to comment Share on other sites More sharing options...
Question
Geoffrey B. Veteran
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
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