Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS background-image: url(none) leading to errors in apache log file

Tags:

html

css

apache

I have run into a strange problem. When I use:

background-image: url(none);

in my css file, it generates an error in the apache log file:

File does not exist: /...../styles/none, referer: http://blabla.com/styles/styles.css

I have used the W3C CSS validator and there are no errors (just some warnings about floats needing widths).

I used to have:

background-image: none;

but I have changed all instances and the most up-to-date stylesheet is used.

Is this normal behaviour or is it more likely that I have an error somewhere in my stylesheet?

like image 841
jeroen Avatar asked Jul 21 '09 18:07

jeroen


People also ask

Why is my CSS background image not working?

Make sure the image path is set correctly in the background-image url. Once you have made sure that your CSS file is linked correctly, also check that the image itself is set correctly. Again, you will want to open your code inspector in the browser to check.

Why is my background color not showing up CSS?

that is because you have set the background color, and then overwritten it by using the background shorthand…. either move the background-color call after the background shorthand, or add it TO the shorthand… the browser interprets your current code like this…

How do you code an image to display text if the image doesn't load?

The alt attribute is meant to be used as an alternative text if the image is not available. Text-only browsers cannot display images and will only display the text specified in the alt attribute.


1 Answers

This is normal. By using the url() syntax, anything you put into the brackets is considered to be a URL. The browsers are making an http request for a resource called none.

Basically, you've specified an invalid url for a background image.

like image 153
zombat Avatar answered Oct 26 '22 18:10

zombat