Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Richard Terris 273 posts 715 karma points
    Sep 18, 2010 @ 18:35
    Richard Terris
    0

    background-image css

    Hi all

    I noticed that this problem has been raised and in the past and apparently fixed, but none of the fixes work for me,

    The issue is that I have a background image "umbraco/images/header2.png" - I created the images folder because I don't want this in the editable media folder.

    On top of this sits a logo "umbraco/images/logo.png"

    The background image is reference in the css file and the logo is referenced in the masterpage.

    Basically, the logo is loading fine, but the background image is not.

    Within the master page, I have <img src="images/logo.png" height="100" />

    In the css I have background-imageurl('/images/header2.png'no-repeat;

    I have tried variations of the path

    ('images/header2.png'  , 'umbraco/images/header2.png') etc

    When i enter localhost/umbraco/images/header2.png the image loads fine by itself.

    Being new to Umbraco, I'm sure that it is something I have done or not done.

    Interestingy, I did at one point think it didn't like .png files so I created

    a jpeg version and loaded it into the media folder and it still won't load from

    there... Can anyone help?

     

    Thanks

  • Dan 1285 posts 3917 karma points c-trib
    Sep 18, 2010 @ 22:05
    Dan
    0

    Hi Richard,

    The image reference in the CSS file is relative to the CSS file.  If in doubt try using the full file path to the image (localhost/umbraco/images/header2.png) in the CSS file.  Also, try not using apostrophes in the CSS image reference.

    Hope this sorts your issue.

  • Ferry Meidianto 36 posts 63 karma points
    Sep 18, 2010 @ 22:22
    Ferry Meidianto
    1

    Hi Richard,

    /images/header2.png means the file is located inside images folder on site root.
    since you save the file in /umbraco/images/ then you must write it as
    /umbraco/images/header2.png

    Cheers,
    Ferry

Please Sign in or register to post replies

Write your reply to:

Draft