Welcome to TalkGraphics.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2010
    Location
    UK
    Posts
    348

    Default Snippet of code for centering a large background tile?

    Hi

    Please could someone help? Am looking for snippets or tweak or something to enable me to apply a color to a web page background and also a large centered image on top of that (not stretched, just a centered background). Not had success so far. Please could someone suggest what code goes where? Would prefer to do it via linked file and code so that I can preview the result in Xara.

    Many thanks,

    Ali

  2. #2
    Join Date
    Aug 2000
    Location
    Placitas, New Mexico, USA
    Posts
    41,498

    Default Re: Snippet of code for centering a large background tile?

    Look at Cover's Tweakset. It is at the very top of the threads in this forum.

  3. #3
    Join Date
    Mar 2009
    Location
    England
    Posts
    2,044

    Default Re: Snippet of code for centering a large background tile?

    Hi Ali

    Here are two methods I have used successfully.

    Method one is to use the following code in the head section of the page.

    Code:
    <style type="text/css">
    html {
    background-image: url("http://www.goldenarrow.me.uk/goldenarrow_htm_files/bgimage.jpg");
    background-repeat: no-repeat;
    background-position:center top;
    background-color: #ffffd4;
    }
    </style>
    The disadvantage with this method s that the background does not appear in the editor (it does in preview though)

    The second method involves chopping up the image. See attached.
    Attached Files Attached Files

  4. #4
    Join Date
    Oct 2010
    Location
    UK
    Posts
    348

    Default Re: Snippet of code for centering a large background tile?

    Thanks so much to both. I must revisit the tweaks. I got put off once when using one of them, which tiled a nonrepeating background in the work window, making it almost impossible to continue with the design. Note to self... use the tweak after you have finished the rest if the design!

    I think drwyd might have an interesting solution, too. I did find something similar on a different forum, but that didnt render the bkgrnd properly and I couldn't fix it. Will try all the kind advice, and report back. Really appreciate the help.

  5. #5
    Join Date
    Oct 2010
    Location
    Land of Immigrants
    Posts
    136

    Default Re: Snippet of code for centering a large background tile?

    But I did try this and can mess around with this if this is easier vs. my other post of messing with the tutorial.

 

 

Tags for this Thread

Bookmarks

Posting Permissions

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