I did that as well and it is still not rendering.
Main Topics
Browse All TopicsI've got the following in my StyleSheet:
h1
{
background-color: #C1D7DB;
border: thin solid #0000FF;
background-image: url(pic.gif) no-repeat;
font-family: 'Century Gothic';
font-size: large;
font-weight: bolder;
font-style: normal;
font-variant: normal;
text-transform: capitalize;
color: #0000FF;
}
However the pic does not render. I've tried to put the entire path as well as relative path, and it still does not render. What's the issue?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I believe that the problem may be due to the "no-repeat" value in your "background-image" property definition. Background-image can only take one value: the url() (file or http reference) of the image. The background property, on the other hand, can take a list of definitions. You can do it one of two ways:
h1
{
background-color: #C1D7DB;
border: thin solid #0000FF;
background-image: url(pic.gif);
background-repeat: no-repeat;
font-family: 'Century Gothic';
font-size: large;
font-weight: bolder;
font-style: normal;
font-variant: normal;
text-transform: capitalize;
color: #0000FF;
}
--OR--
h1
{
background: #C1D7DB url(pic.gif) no-repeat;
border: thin solid #0000FF;
font-family: 'Century Gothic';
font-size: large;
font-weight: bolder;
font-style: normal;
font-variant: normal;
text-transform: capitalize;
color: #0000FF;
}
Hope that helps!
You still have the "no-repeat" value in your background-image attribute. Please see my original post for the solution. Also, referencing the image using "file:///" may not work in all browsers. It is best to reference the image relative to the page or absolutely via http://.
I had the no-repeat removed and it still does not render. Also, I've tried relative path, however http:// would only apply if the image was not local, correct?
Assuming that your web page is running under SOME kind of web server (IIS, Apache), even if it is only a web server set up on your local machine, you could still use "http://" to reference the image, like http://localhost/pic.gif (if your image was in your web root folder). The way to test is to copy the http:// url to your image from your CSS file and paste it in your browser. If the image displays on its own then your path is correct, obviously.
For testing purposes, I would suggest either using the full, verified http:// path to the image on your web server, or just put the html file, the css file, and the image file all in the same directory (then reference the image like "background-image: url(pic.gif);"), just to ensure that referencing the image isn't the problem. You could even start with the CSS from hielo, as he has written out a complete and correct version of the css for you. Just change the path to the image in the url() value.
Also, when referencing the path to the image (either with http:// or relative path) make sure that you don't put quotes or "ticks" around the file path. For example:
GOOD -- background-image: url(pic.gif);
BAD -- background-image: url('pic.gif');
Is IE not rendering the image when using url(file:///....) to reference the image, or when you use http:// or the relative image path to reference the image? Do other browsers (FireFox, Opera) render the image when IE does not? If you are seeing the image in some editor's (Dreamweaver?) design view, it could be that the editor's internal browser does recognize the file:/// path, whereas a browser may not. Since you are creating this web page to be deployed to a web server, always use the full url to the image, or even better because it is faster, the relative path to the image.
The way you are referencing your image says that your html page is in some folder (call it HTML), and your image (pic1.gif) is in the images folder under the App_Themes folder, which is on the same level as the HTML folder. An illustration of this is:
ROOT
----[HTML]
--------html file here
----[App_Themes]
--------[Images]
------------pic1.gif
Is this correct? If not, then "../App_Themes/Images/pic1
Business Accounts
Answer for Membership
by: hieloPosted on 2008-06-30 at 13:14:35ID: 21902661
Make sure you provide the correct path to your image. Try: m/images/p ic.gif) scroll no-repeat top left;
h1
{
border: thin solid #0000FF;
font-family: 'Century Gothic';
font-size: large;
font-weight: bolder;
font-style: normal;
font-variant: normal;
text-transform: capitalize;
color: #0000FF;
background: #C1D7DB url(http://www.yoursite.co
}