How To Align A Background To Bottom Center?

Discussion in 'CSS' started by gobbly2100, Nov 9, 2007.

  1. #1
    Hello,

    What is the CSS to align a background image to the bottom center of a div?
     
    gobbly2100, Nov 9, 2007 IP
  2. webdesigner

    webdesigner Well-Known Member

    Messages:
    489
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    110
    #2
    
    background: url(image.jpg) bottom center;
    
    Code (markup):
     
    webdesigner, Nov 9, 2007 IP
  3. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hehe.

    Also, you can just say "bottom" as when you don't say what the other value is, it defaults to "center." Just remember you can't mix words with numbers: no bottom 40px or anything.
     
    Stomme poes, Nov 9, 2007 IP
  4. le_gber

    le_gber Peon

    Messages:
    28
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You could also say 100% 50% may give you more power over where the image 'sits'
     
    le_gber, Nov 10, 2007 IP