Shrink or enlarge the background-image so the image is stable

Discussion in 'CSS' started by Philosophaie, Mar 2, 2012.

  1. #1
    What I want is to be able to shrink or enlarge the background-image so the image is stable at 20% no matter what the screen size is.

    Here is my CSS code:

     
    Philosophaie, Mar 2, 2012 IP
  2. wiicker95

    wiicker95 Well-Known Member

    Messages:
    438
    Likes Received:
    37
    Best Answers:
    10
    Trophy Points:
    100
    #2
    That code is a silly mess.

    -Do NOT put the quotes in url().
    -top: 0%; does not exist.
    -height: 20%; makes no sense at all.

    Just make the position fixed, and add width and height 100%;
     
    wiicker95, Mar 2, 2012 IP
  3. Philosophaie

    Philosophaie Member

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #3
    My css heading is not the topic.

    Only how it pertains to the topic.

    Is it possible to fit the same full image.jpg to the top 20% at all times no matter what the screen or browser size?
     
    Philosophaie, Mar 2, 2012 IP
  4. PPCoach

    PPCoach Peon

    Messages:
    107
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Why don't you just make the height in pixels then? If the top 20% is 400px, just say 'height: 400px;'.
     
    PPCoach, Mar 2, 2012 IP