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. R.A.M. wrote:

    > background-image: "Images/DotNET_90x70_light.jpeg"


    > Could you explain me please why it doesn't work and how to do it
    > correctly?


    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 <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
     
    David Dorward, Mar 18, 2006
    #3
  4. On Sat, 18 Mar 2006 09:49:53 +0100, R.A.M. <>
    wrote:

    > 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"
    > }
    > Could you explain me please why it doesn't work and how to do it
    > correctly?


    When something doesn't work as you expected it to, validate:
    <URL:http://jigsaw.w3.org/css-validator/validator?text=.withbackground%0D%0A%7B%0D%0A++background-image%3A+%22Images%2FDotNET_90x70_light.jpeg%22%0D%0A%7D&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>

    --
    ______PretLetters:
    | weblog | http://www.pretletters.net/weblog/weblog.html |
    | webontwerp | http://www.pretletters.net/html/webontwerp.html |
    |zweefvliegen | http://www.pretletters.net/html/vliegen.html |
     
    Barbara de Zoete, Mar 18, 2006
    #4
  5. R.A.M.

    Neredbojias Guest

    With neither quill nor qualm, R.A.M. quothed:

    > 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!


    The correct line is:

    background-image:url(Images/DotNET_90x70_light.jpeg);

    --
    Neredbojias
    Contrary to popular belief, it is believable.
     
    Neredbojias, Mar 18, 2006
    #5
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nilesh
    Replies:
    7
    Views:
    9,571
    Martin Dechev
    Apr 20, 2004
  2. Noozer
    Replies:
    5
    Views:
    52,668
  3. jc
    Replies:
    3
    Views:
    1,877
  4. jc
    Replies:
    1
    Views:
    1,496
    Neredbojias
    Mar 19, 2008
  5. Dj Frenzy
    Replies:
    3
    Views:
    416
    Robert
    Feb 10, 2004
Loading...

Share This Page