Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Senior Coder
    Join Date
    May 2004
    Posts
    1,456
    Thanks
    15
    Thanked 0 Times in 0 Posts

    2 background colors

    It is possible in css to make one div 2 different background colors?

    Basically I want the top of the div to be one color and 1/4 a way from the bottom to be a different color?

    Can i do this in css or do i need to make a background image?

  • #2
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    A background image would be easiest; unless you wanted to mess around with absolute positioning to make the content go over two different coloured DIV's.
    Last edited by mark87; 01-03-2006 at 05:25 PM.

  • #3
    New Coder
    Join Date
    Dec 2005
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yeah, go with a background image, it would be easiest and would prevent a lot of unneccassary coding.

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    One background

    To answer the question: no, an element can only have one background color and one background image.
    You may be able though to get the desired effect by applying both a background color and an image, but to help with that we need to know what the desired effect should look like.
    Regards,
    Ronald.
    ronaldvanderwijden.com


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •