Results 1 to 2 of 2

Thread: background repeat not working (1st ? be gentle pls)

  1. #1
    pam2923 Guest

    background repeat not working (1st ? be gentle pls)

    I've copied what I think are the valid areas of my problem. The image shows up fine, just doesn't repeat. I'm using a combination of Dreamweaver and me (where the problem probably lies). Dreamweaver gives me an error message saying "the tag: "div" doesn't have an attribute: "background-repeat" in currently active versions.[XHTML 1.0 strict]" Is it possible to get the image to repeat?

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    snip

    #repeater
    {
    width: 800px;
    height: 200px;
    margin: 0 auto;
    background-color: #FFFFFF;
    background: url(images/bottom-repeater.jpg);
    background-repeat: repeat-y;
    background-position: left top;
    }

  2. #2
    Join Date
    Feb 2006
    Location
    Salisbury UK
    Posts
    4,332
    Of course there is an attribute background-repeat, but Dreamweaver hasn't explained the problem.

    If you state each attribute separately you need the image in background-image:-
    Code:
    #repeater
    {
    width: 800px;
    height: 200px;
    margin: 0 auto;
    background-color: #FFFFFF;
    background-image: url(images/bottom-repeater.jpg);
    background-repeat: repeat-y;
    background-position: left top;
    }
    If you use the short version background then all the attributes need to be the short version:-
    Code:
    #repeater
    {
    width: 800px;
    height: 200px;
    margin: 0 auto;
    background: #FFFFFF url(images/bottom-repeater.jpg) left top repeat-y;
    }
    (according to the rules the color should be stated first although it will work if after the url. I think it should be first so that if the image doesn't show the color will show).
    Code downloaded to my PC will be deleted in due course.
    WIN7; IE9, Firefox, Opera, Chrome and Safari for Windows; screen resolution usually 1366*768.
    Also IE6 on W98 with 800*600 and IE8 on Vista 1440*900.

Similar Threads

  1. Can you get an image to repeat without making it the background to a container?
    By kryptobs2000 in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 12 Mar 2010, 12:54 AM

Posting Permissions

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