6 replies [Last post]
vbo
vbo's picture
Offline
Regular
Last seen: 10 years 48 weeks ago
Timezone: GMT+3
Joined: 2010-04-01
Posts: 12
Points: 13

Hi all! I have code like this

<html>
 <head>
	<style>
	DIV.className
	{
		background-image: url(image.jpg);
	}
......
 
/*skin section*/
	DIV.className
	{
		background-image: none;
		/*or background-image: url(someOtherImage.jpg);*/
	}
	</style>
 </head>
 
 <body>
	<div class="className">tttttt</div>
 </body>
</html>

In all browsers is everything good... but Safari browser make request to server for image.jpg (for not existing image). How to prevent this request?

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 6 years 20 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

vbo wrote: How to prevent

vbo wrote:

How to prevent this request?

Remove the missing image from your stylesheet.

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

vbo
vbo's picture
Offline
Regular
Last seen: 10 years 48 weeks ago
Timezone: GMT+3
Joined: 2010-04-01
Posts: 12
Points: 13

> Remove the missing image

> Remove the missing image from your stylesheet.
Is impossible...
I have some classes common for lat skins (with image.jpg). But in few skins defined images is not needed (or need f.e. image.gif).
To avoid this problem I put empty file (image.jpg) to skin directory, but is just workaround... Is not a correct fix...

vbo
vbo's picture
Offline
Regular
Last seen: 10 years 48 weeks ago
Timezone: GMT+3
Joined: 2010-04-01
Posts: 12
Points: 13

Currently i use CSS: @import

Currently i use CSS:

@import url("../common/Buttons.css");
@import url("../common/Calendar.css");
@import url("../common/Combo.css");
@import url("../common/MessageBox.css");
@import url("../common/RadioBox.css");
@import url("../common/CheckBox.css");
@import url("../common/Wizard.css");
@import url("../common/Tree.css");
@import url("../common/Help.css");
 
<strong>@import url("skin.css");</strong>

and impossible to change files in "common" directory.

CupidsToejam
CupidsToejam's picture
Offline
Guru
Florida
Last seen: 5 years 25 weeks ago
Florida
Timezone: GMT-4
Joined: 2008-08-15
Posts: 2637
Points: 1556

use specificity to override

use specificity to override the first style.

vbo
vbo's picture
Offline
Regular
Last seen: 10 years 48 weeks ago
Timezone: GMT+3
Joined: 2010-04-01
Posts: 12
Points: 13

CupidsToejam wrote: use

CupidsToejam wrote:

use specificity to override the first style.

what you mean? In my sample second rule override first (my DIV will not have any picture), but Safari ping server for this file (as result i have reported crash "File not fount").

CupidsToejam
CupidsToejam's picture
Offline
Guru
Florida
Last seen: 5 years 25 weeks ago
Florida
Timezone: GMT-4
Joined: 2008-08-15
Posts: 2637
Points: 1556

http://lmgtfy.com/?q=specific