CSS: background image

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

  1. R.A.M.

    R.A.M. Guest


    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:
    background-image: "Images/DotNET_90x70_light.jpeg"
    which I use on these pages
    <link rel="Stylesheet" type="text/css" href="Styles.css" />
    <body class="withbackground">
    Could you explain me please why it doesn't work and how to do it
    Thank you very much!

    R.A.M., Mar 18, 2006
    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
    1. Advertisements

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

    Value: <uri> | none | inherit

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


    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
  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:
    Barbara de Zoete, Mar 18, 2006
  5. R.A.M.

    Neredbojias Guest

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

    Neredbojias, Mar 18, 2006
    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.