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 8 of 8
  1. #1
    Regular Coder
    Join Date
    Dec 2008
    Posts
    120
    Thanks
    15
    Thanked 2 Times in 2 Posts

    Unhappy Strange Background Repeat.

    Hi,

    I have a div box which has different colors to its sides, it has red color to the left and black to the right.

    Take a look at this image:
    http://www.mzeb.com/repeat.png

    What I want is, I want a repeat background image which will repeat red line to the left, and grey to the right.

    I've tried a background like:
    ______________________

    and used :
    Code:
    background: url(images/bg.png) repeat;
    But it doesn't work!

    Thanks in advance for the help

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    I don't understand. Which exactly is the background, where and on which direction should be repeated?
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    Regular Coder
    Join Date
    Dec 2008
    Posts
    120
    Thanks
    15
    Thanked 2 Times in 2 Posts
    both direction should be repeated

  • #4
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    on which axis? X I presume. But where is that image? Where should it be repeated? It could be of some help if you would detail a little but your aim.

    About repeated backgrounds:
    http://www.codertools.com/css_help_g...nd-repeat.aspx
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #5
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,333
    Thanks
    5
    Thanked 363 Times in 360 Posts
    I dont think that image you showed us is a repeating image. I say this because it has more than one color with definate beginnings and endings.

    Think about it. If you have a black line and tell it to repeat on the X axis, then it will repeat that SAME black line as far left and right as the container is in will allow it.

    But a background image with 4 distinct colors all ending at a specified place on the page is not a repeating image.
    Teed

  • #6
    Regular Coder
    Join Date
    Dec 2008
    Posts
    120
    Thanks
    15
    Thanked 2 Times in 2 Posts
    Forget about the image, I just needed an idea, on how to repeat a background which is different colors to its sides. I just need the code

  • #7
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    background: url(images/bg.png) repeat-x;
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #8
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,333
    Thanks
    5
    Thanked 363 Times in 360 Posts
    I just gave you the idea. Create the image with the different colors you need and make it the height and width you need.
    Teed


  •  

    Posting Permissions

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