CSS: background image

Discussion in 'HTML' started by R.A.M., Mar 18, 2006.

  1. R.A.M.

    R.A.M. Guest

    Hello,

    Could you help me please with a simple problem?
    I want to have background image on some pages of a website I am
    creating. I added a ass to Styles.css:
    .withbackground
    {
    background-image: "Images/DotNET_90x70_light.jpeg"
    }
    which I use on these pages
    <link rel="Stylesheet" type="text/css" href="Styles.css" />
    <head>
    <body class="withbackground">
    Could you explain me please why it doesn't work and how to do it
    correctly?
    Thank you very much!

    /RAM
     
    R.A.M., Mar 18, 2006
    #1
    1. Advertisements

  2. R.A.M.

    R.A.M. Guest

    I added a ass to Styles.css:
    "a class", of course...
     
    R.A.M., Mar 18, 2006
    #2
    1. Advertisements

  3. http://www.w3.org/TR/CSS2/colors.html#background-properties

    'background-image'
    Value: <uri> | none | inherit

    And following the link to see where "<uri>" is described:

    http://www.w3.org/TR/CSS2/syndata.html#value-def-uri

    URI values in this specification are denoted by <uri>. The functional
    notation used to designate URIs in property values is "url()", as in:

    BODY { background: url("http://www.bg.com/pinkish.gif") }
     
    David Dorward, Mar 18, 2006
    #3
  4. When something doesn't work as you expected it to, validate:
    <URL:http://jigsaw.w3.org/css-validator/... }&warning=0&profile=css21&usermedium=screen>

    Then look up how you should have done it properly:
    <URL:http://www.w3.org/TR/REC-CSS2/colors.html#propdef-background-image>
     
    Barbara de Zoete, Mar 18, 2006
    #4
  5. R.A.M.

    Neredbojias Guest

    With neither quill nor qualm, R.A.M. quothed:
    The correct line is:

    background-image:url(Images/DotNET_90x70_light.jpeg);
     
    Neredbojias, Mar 18, 2006
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.