1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

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