Results 1 to 10 of 10
  1. #1

    stupid css question

    I'm learning css, and it's going well except: I don't know where to store images or style sheets, or what to put for the url (or src.)for an image in the style descriptions. Example: I want to use an image currently in 'my pictures' for the body background. I got this far;

    <html>
    <head>
    <style type="text/css">
    body {background-image: ??? }

    I just don't know where to look for this answer. I'm studying the W3School online tutorials, and I can't find an answer there. I must note that this is all for practice at the moment, all off line, I mean I'm using Notepad and then IE7 to check the results. Help!!
    'I think my intimate relationship with electronics started as a child when I was playing with a screwdriver and a wall plug, Doc, and...'

  2. #2
    Administrator Dave's Avatar
    Join Date
    Sep 2004
    Location
    Te Awamutu, New Zealand
    Posts
    3,959
    Blog Entries
    79
    body { background:url(image.gif); }

    You can also specify a background colour to use if the image is not available, as well as position and repeat attributes, e.g.:

    body { background:url(image.gif) #FFFFFF top left repeat; }

    There may be more you can do with this but I'm not sure off the top of my head.
    Dave Owen
    MediaCollege.com

  3. #3
    Thanks for the reply, Dave

    But I think I wasn't clear and I see why. OK, I don't know how to word the pathway to the image is what I meant. I know it's a jpeg image called 'myimage.jpg' but It won't recognize or can't find it, I don't know which. I tried body {background-image:url(C:\myimage.jpg)} and some other pathway combinations and nothing works. Once I can get the style sheet to find the image and bring it up I'm pretty sure I can get on with it. I have no trouble with bg colors, text, tables, etc

    Thanks again!
    'I think my intimate relationship with electronics started as a child when I was playing with a screwdriver and a wall plug, Doc, and...'

  4. #4
    Administrator Dave's Avatar
    Join Date
    Sep 2004
    Location
    Te Awamutu, New Zealand
    Posts
    3,959
    Blog Entries
    79
    If I understand correctly, this may help:
    http://www.mediacollege.com/internet...inks.html#drel

    It's part of a tutorial about hyperlinks but the same principle applies to images sources.

    Personally I use root-relative links for anything in the stylesheet, so it can be used in any part of the site without breaking links.

    If you can't figure it out, it might pay to start with the image in the same directory, get that working and then try moving it. Alternatively show me the URL and I'll have a look.
    Dave Owen
    MediaCollege.com

  5. #5
    Yes, thank you Dave, the site helped. I got it to work (so far). I just had to create a dedicated directory, so to speak. As for a url, I'm doing this to learn the language first, then work on a site. Nothing is published to a server yet. Makes it difficult, I know, but it's a challange.

    I have another stupid question: I assume there is a particular list of fonts I can use. I have had no luck finding it. I tried using 'edwardian script 1' but it doesn't work. Is it dependant on the text editor I use? I'm using Wordpad because it was recomended.
    'I think my intimate relationship with electronics started as a child when I was playing with a screwdriver and a wall plug, Doc, and...'

  6. #6
    Nevermind, sorry, sorry, I found the answer. A couple sites about font design, etc. Heavy stuff, but super-cool!
    'I think my intimate relationship with electronics started as a child when I was playing with a screwdriver and a wall plug, Doc, and...'

  7. #7
    Administrator Dave's Avatar
    Join Date
    Sep 2004
    Location
    Te Awamutu, New Zealand
    Posts
    3,959
    Blog Entries
    79
    I've been working with CSS for ages and I still struggle with it. It's quite a minefield but it's a lot of fun and worth the effort. Good luck
    Dave Owen
    MediaCollege.com

  8. #8
    well then, I am glad to have an acquaintance with someone of your expertise. Please be sure I will have MANY more questions in the future. But, yea, landmines galore. I've wanted to study this stuff for years and still can't afford the classes, which at the local level around here, they don't dig deep enough for me anyway. But half the fun is findinding the info online or wherever. I'm getting in deep, though. I'm finding myself looking for the roots of software and languages, what exactly makes it all tick (the story of any engineers' life). Thanks for the luck>
    'I think my intimate relationship with electronics started as a child when I was playing with a screwdriver and a wall plug, Doc, and...'

  9. #9
    Administrator Dave's Avatar
    Join Date
    Sep 2004
    Location
    Te Awamutu, New Zealand
    Posts
    3,959
    Blog Entries
    79
    I should emphasize... I still struggle with it
    Dave Owen
    MediaCollege.com

  10. #10
    Then I'm also glad I'm not alone.
    'I think my intimate relationship with electronics started as a child when I was playing with a screwdriver and a wall plug, Doc, and...'

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Subscribe to us on YouTube