My CSS file is:
#name_wrong_img
{
width:43px;
height:29px;
}
This is my HTML code:
<img id="name_wrong_img" src="wrong.jpg" />
The above code is working well in both Firefox and Chrome.
#name_wrong_img
{
content:url(wrong.jpg);
width:43px;
height:29px;
}
<img id="name_wrong_img" />
This is working well in Chrome. But not in Firefox. What is the problem in this?
Clear the Cache and remove the Cookies for websites that cause problems via the "3-bar" Firefox menu button (Settings). Start Firefox in Troubleshoot Mode to check if one of the extensions ("3-bar" menu button or Tools -> Add-ons -> Extensions) or if hardware acceleration or userChrome. css is causing the problem.
Clear the cookies and cache If a website has updated their code, Firefox may still be using some of the old code along with some of the new, which can make a web page display incorrectly. To fix this, you need to clear the cookies and cache: Click the menu button. to open the menu panel.
Set Firefox to open links in appsTap the menu button. Tap Settings. Scroll down to the Advanced section, next to Open links in apps use the slider button to turn this ON.
Firefox doesn't support the content
property in the same way as Chrome — on img
elements and/or when the source is an image.
<img>
represents a content image. If you use it, it should have a src
and an alt
.
From the specification:
The src attribute must be present, and must contain a valid non-empty URL potentially surrounded by spaces referencing a non-interactive, optionally animated, image resource that is neither paged nor scripted.
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