ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Background Image Won't display on links

July 06, 2011 1:13pm

Subscribe [3]
  • #1 / Jul 06, 2011 1:13pm

    Greetings,

    I’m very new to Expression Engine. I am in the process of uploading a static HTML site and converting it into an EE dynamic site. My main navigation menu uses CSS background images to display links but I can’t for the life of me get them to display properly. I’ve checked the image path a million times and it’s right. I’ve pasted the code below, I believe my problem source is in the background:url. Thanks in advance!

    Here’s the html:

    <div class="menu1">
                        <a href="#%22id=%22home" title="Home"></a>
                             </div>

    Here’s the CSS:

    .menu1 {
        float:left;
        width:70px;
        height:31px;
        padding-top: 20px;
        padding-left: 66px;
    }
    
    #home {
        display:block;
        width:70px;
        height:31px;
        background:url ({site_url}images/FATFF/Design/Links_Sprite/home.jpg) no-repeat;
    }
    
    #home:hover{
        background-position: 0 -31px;
    }
  • #2 / Jul 06, 2011 8:35pm

    Rob Allen

    3114 posts

    Try chnaging the image path to:

    background:url (/images/FATFF/Design/Links_Sprite/home.jpg) no-repeat;
  • #3 / Nov 20, 2011 5:06pm

    DeeCee

    118 posts

    I am testing 2.3.1 and have the same problem in the CSS of my second MSM site. It renders the site_url correctly in both the HTML and CSS of the default site, and the HTML of the second MSM site, but not the CSS. Interestingly enough, when I tested 2.3.1 on WAMP, it rendered the CSS correctly for both the default site and the second site.

    Is removing {site_url} from the css images still the recommended solution? I would prefer to use the same format in both my sites - it appears to be a bug to me.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases