Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Background .png not showing in Chrome and Firefox

I must be missing something completely obvious here, but can't find anything online to tell me otherwise.

I'm trying to pull a .png into a page using:

background:url(img/runner1.png) no-repeat;

I know the path is correct because doing the same with a jpg works:

background:url(img/header.jpg) no-repeat;

It does seem to work in Safari, but not in Chrome or Firefox.

Am I missing something here?


EDIT - I am using:

#runner1{
background:url(img/runner1.png) no-repeat;
float: left;
border: 1px solid #FFF;
width: 195px;
height: 205px;
}

for the following element:

<div id="runner1"></div>

The page is just running locally from my desktop (so no server involved).

As mentioned previously the paths aren't the problem because a jpg from the same directory works.

Firebug says:

runner1.png 
GET
Success
image/png
index.html:201  
0B  
8ms

But I can't see the preview or response in Firebug.

Also accessing the file directly returns the same result.

like image 421
user1076082 Avatar asked Dec 06 '11 21:12

user1076082


People also ask

How do I fix pictures not displaying in Firefox?

Clear cookies and cache Sometimes problems loading websites can be fixed by clearing the cookies and cache. to open the menu panel. In the Time Range to clear: drop-down, select Everything. Below the drop-down menu, select both Cookies and Cache.

Why is PNG showing checkered background?

The checkered pattern indicates transparency in the image's background. You only see it in Photoshop. If you don't want to see it while working in Photoshop, go to Photoshop's Preferences, then “Transparency & Gamut”. You can eliminate the pattern or change size and color of the blocks.

Why PNG file background is black?

Basically, when you copy a PNG file from the Internet, the system doesn't copy its background information. As a result, when you paste it in Photoshop, it automatically gets a black background.

Does Chrome support background?

Choose a background themeChoose a background image that appears when you open a new tab. Settings. to open the Chrome Web Store. On the left, click Themes and select a theme.


1 Answers

Solved!

It would appear that saving PNGs with Photoshop creates a PNG which isn't compatible with chrome or firefox. So instead, I opened the file with Fireworks, re-saved and the pngs are working.

like image 53
user1076082 Avatar answered Sep 25 '22 16:09

user1076082