How do I, create a two color body ?

Discussion in 'CSS' started by Camay123, Sep 28, 2007.

  1. #1
    How do I create such body background color ?

    How can my body be green and blue for example, but split 1/4 - 3/4, or split at my header limit ? Also compatible with many screen resolution.

    See attach images for example.
     
    Camay123, Sep 28, 2007 IP
  2. Lethal7

    Lethal7 Active Member

    Messages:
    2,262
    Likes Received:
    56
    Best Answers:
    0
    Trophy Points:
    90
    #2
    use a background image that is a gradient.
     
    Lethal7, Sep 28, 2007 IP
    Camay123 likes this.
  3. Crimsonc

    Crimsonc Peon

    Messages:
    616
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #3
    create the image with the colors and proportions you want then apply this code to the body

    
    body {
    
    background-image: url(images/background.gif) repeat-x #000000;
    }
    
    Code (markup):
    you want to make '#000000' the same color as the bottom half of the image as 000... is just black.

    I hope this helps :)
     
    Crimsonc, Sep 28, 2007 IP
    Camay123 likes this.
  4. jared

    jared Peon

    Messages:
    231
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You would do something like this.

    
    body {
        background: url(images/backgroundimage.jpg) repeat-x #CCCCCC;
    }
    
    Code (markup):
    You would make the top part (which is the green part according to you mockup) an image which would only repeat horizontally. Then just assign a color for the rest of the background. Replace #FFFFFF which the color of your choice.

    cheers

    oh and note that you can combine all the background properties into one line. Short hand CSS :)
     
    jared, Sep 28, 2007 IP
    Camay123 likes this.
  5. Crimsonc

    Crimsonc Peon

    Messages:
    616
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #5
    you've just repeated what I said...
     
    Crimsonc, Sep 28, 2007 IP
  6. jared

    jared Peon

    Messages:
    231
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #6
    ... notice we posted at the same time.

    Besides that, You used background-image incorrectly in your code. I assume you meant to use 'background' as the background-image property is only used to set an image path.
     
    jared, Sep 28, 2007 IP
  7. Camay123

    Camay123 Well-Known Member

    Messages:
    3,423
    Likes Received:
    86
    Best Answers:
    0
    Trophy Points:
    160
    #7
    Thanks to all who helped. Rep added
     
    Camay123, Sep 28, 2007 IP