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.
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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With