Copied to clipboard

Flag this post as spam?

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


  • Kristian Frost 18 posts 102 karma points
    Aug 26, 2009 @ 15:18
    Kristian Frost
    0

    Images in CSS

    Hello.

    I have uploaded an imagefile into the "media" folder, and now I would like to use it as a backgroundimage in my CSS. How can I do this?

    Right now I have hardcoded the URL of the image into my stylesheet (like /media/2/bg.png).

    /Kristian Frost

  • dandrayne 1138 posts 2262 karma points
    Aug 26, 2009 @ 15:35
    dandrayne
    102

    I'd only use the media library for "content" images, not for site css (unless e.g. the author should be picking a background image).

    Here's how I normally do this

    1. Create site templates in static html, with css in a "css" folder and js etc in "scripts", to mirror umbraco
    2. Upload to the server, with all site design images in /css/images
    3. Reference images in the css, which is now present in the "settings" section of umbraco

    Putting site design images in the media library is abad idea as people can then delete them..

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Aug 26, 2009 @ 16:32
    Ismail Mayat
    1

    Kristian,

    There was a big flame war started by some guy Bill a while back he was asking similar question athough not as nicely as you :-}. Anyhow I posted something on there that i did see http://our.umbraco.org/forum/using/ui-questions/3124-Referencing-Media-objects?p=4 basically had a bunch of images that were background and needed to change.  I also posted another suggestion further on about another way of referencing images in a css its a bit long winded but in theory it would work.  Hopefully future version of umbraco will have ability to insert images in the media section into css editor.  He loved it so much he give everyone in the post negative karma LOL.

    Regards

    Ismail

  • Kristian Frost 18 posts 102 karma points
    Aug 27, 2009 @ 13:46
    Kristian Frost
    0

    Thanks for the quicks answers.

    I think dandrayne got a point with the "layout, not content" thing, so I will stick to that solution for now.

    But i also agree that in a future version of Umbraco, a "insert media" button or something could be neat.

    /Kristian

Please Sign in or register to post replies

Write your reply to:

Draft