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
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.
1 Attachment(s)
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.
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.
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.