Reputation: 25
So I've recently developed a website here and I was wondering why my image div (the logo) shows up in Safari, IE and Chrome but not in Firefox? I've tried to looking for an answer but nothing has worked. Appreciate the help.
Here's my CSS code:
#logo-header {
padding-top: 70px;
content:url(../img/logo.png);
margin: 0 auto;
outline: 0; max-width: 100%; height: auto;
margin-bottom: -50px;
}
and here's how I initialise it in HTML:
<div id="logo-header"> </div>
Again, thanks for the help.
Upvotes: 1
Views: 900
Reputation: 4549
Instead of content
use background
:
#logo-header {
background: url(../img/logo.png) no-repeat center;
}
Upvotes: 0
Reputation: 44889
content
property is not supported on regular elements (I'm surprised that it works in other browsers). If the image is the part of your content, put it in the markup:
<div id="logo-header">
<img src="img/logo.png" alt="Logo">
</div>
Upvotes: 1
Reputation: 6148
Firefox only accepts content
in pseudo elements lie before
and after
.
You can change your css to something like:
background: transparent url(../img/logo.png) no-repeat center center;
and set an appropriate height (something like 300px
).
Upvotes: 1
Reputation: 943
In place of the attribute 'content'
tries to use 'background-image'
, firefox reads it.
Upvotes: 1