Background images for anchor tags included as part of CSS via custom Theme do not appear in non-IE browsers

I created a custom theme for SharePoint and in it a custom style sheet. Below I am enlisting the issue I faced with background property of anchor elements and the resolution I found.Some good reference articles for creating custom themes :

For the purpose of an example , consider this style element (in my case , it references an image from a custom theme ) :

#siteLogo a {

      background: #94b7d7 url('_themes/FB/FBLogo.gif') no-repeat top left;




Create a custom master page based on any OOB master page (make a copy of OOB Blueband.master)
- remove the DOCTYPE declaration on top
- Add an anchor tag in Placeholder Main, such as :


            <td id="GlobalTitleAreaImage" class="ms-titleimagearea" width="50%" align="left">

            <!-- changed logo for FB Sharepoint Template -->

                  <div id="siteLogo">

                        <a href= target="_blank"></a>




You will notice that when such a custom theme is applied to the site, it will display fine in IE (background images will come up fine), but in non-IE browsers, (I tested in FireFox) , images will not come up.

The root cause of the issue is that CustomSite.master doesn’t have a <!DOCTYPE tag.
Per the W3 visual formatting model - <>
Anchors are inline elements and shouldn’t have an explicit height\width. However, since IE ignores even if the master page has no doctype declaration , IE (without a doctype) displays images while FireFox does not.

So, the solution could be to follow either of below approaches :

Approach1 :

Include display and float elements along with anchor style elements. For e.g. I induced below highlighted change in my custom CSS file ,and was able to get the image displayed in FireFox :

#siteLogo a {

      background: #94b7d7 url('_themes/FB/FBLogo.gif') no-repeat top left;







Use DocType declaration in custom master page. So far, I tested by adding doctype element in my custom master page (all out-of-the-box masterpages have doctype elements) :

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">

There is some good information on DOCTYPE tag and SharePoint master pages available at below links:

Skip to main content