Background question

Discussion in 'HTML & Website Design' started by genius, May 2, 2009.

  1. #1
    I have a question related to the background in a page.For example I want to have a page made with a bg that has 800x600 , if somebody with a resolution of 1024x768 enters the site the picture will start over from the corners.Is there any way to fix this ?
     
    genius, May 2, 2009 IP
  2. CrazyJugglerDrummer

    CrazyJugglerDrummer Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can use CSS to set the background-repeat property for the body to repeat. That will make the background keep repeating to fill up the entire body.
     
    CrazyJugglerDrummer, May 2, 2009 IP
  3. hkmike

    hkmike Peon

    Messages:
    38
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Drummer, I think he wants to know how to stop it from repeating (I think). To do this, use the following CSS code:

    background-repeat: no-repeat ;
    Code (markup):
    You can also use "repeat-x" or "repeat-y"

    On top of that you may also want to position your background a certain way. To do that, you can use this:

    background-position: center;
    Code (markup):
    You can use any combination of top, bottom, left, right, and center for the value or the property. So you could do like "bottom right"

    Another option for you is to fix the background image, so that it doesn't scroll like the rest of the page. (i.e. text would scroll over the stationary background) To do that, use this:

    background-attachment: mixed;
    Code (markup):
    Hope that helped!
     
    hkmike, May 2, 2009 IP
  4. genius

    genius Well-Known Member

    Messages:
    535
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    108
    #4
    And if I want to do this with a table background ? How do I tell it not to repet ?
     
    genius, May 2, 2009 IP
  5. sweeks

    sweeks Member

    Messages:
    191
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    35
    #5
    Add a class like this:

    <td class="myclass"> or <table class="myclass">
    Code (markup):
    and add the same CSS from above like this:

    .myclass {
    
    background-repeat: no-repeat ;
    
    }
    Code (markup):
    Of course adding any other properties you need to it :)
     
    sweeks, May 2, 2009 IP