css question (a newbe one)

Discussion in 'CSS' started by web_master, Aug 8, 2007.

  1. #1
    i set an image as a background but i don't know how to position it, i want it to be on top and centered.
    what is the css code for that one?
    thanks from now
    body {
    background-image:
    url('exam.jpg');
    background-repeat:
    no-repeat;
    background-position:
    center;
    }

    done it guys
    thanks
     
    web_master, Aug 8, 2007 IP
  2. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #2
    I would probably simplify that to:

    body {
    background:url('exam.jpg') top center no-repeat;
    }

    Shorthand CSS, you can shorten all the background properties to a single line.

    The key word you were looking for is 'top'.
     
    deathshadow, Aug 8, 2007 IP