View Full Version : how do I make the bg not tile and repeat?
crj
September 7th, 2001, 20:20
is there a code that lets me make my background image not repeat and stay as 1 image? make it so it doesn't do a tile effect?
meow
September 7th, 2001, 20:41
Yes, with CSS. With HTML use it as background in a table and make the table small enough for it not to tile.
LastActionHero
September 8th, 2001, 05:24
I always wanted to know how to do this? Meow how is it done in CSS? And background in tables are not supported by Netscape.
Dusty
September 8th, 2001, 09:29
Table backgrounds weren't supported in Netscape 3.0 and below, they are in all other versions.
Another option, which is probably the simplest and most widely supported, is just to increase the height and width of your background image by a few thousand pixels. It would increase the file size a bit, but not that much since the majority of the image would just be blank. Doing that would pretty much prevent it from tiling.
LeX
September 8th, 2001, 09:43
The simplest way to do this in IE:
<BODY background="yourbackground.jpg" bgproperties="fixed">
MaGiCSuN
September 8th, 2001, 09:46
hmm...
i don't know but it's only possible with html like lex has said above
LeX
September 8th, 2001, 09:51
http://www.dynamicdrive.com/dynamicindex14/bgslide.htm
You can turn your background into a slide show in IE. Modify it if you don't want it to change pictures, and it will be a static background image done with JavaScript! (In other words, this is something that's not limited to HTML... ;))
Dusty
September 8th, 2001, 09:51
He said prevent it from tiling, not make it fixed. That wouldn't prevent it from tiling.
And there are better cross-browser ways of making a background fixed.
<edit>
Forgot to add, if you want to use CSS, what you're looking for is:
background-repeat: no-repeat;
</edit>
MaGiCSuN
September 8th, 2001, 09:55
whatever
i always take the <body> html code that's the easiest one
and if netscape doesn't see it? well that's bad for them......
i don't do anything about it
the most part of visitors of my site has IE so why should i build for netscape? i don't see the point in it........
LeX
September 8th, 2001, 10:02
In that case, to prevent it from tiling, create a new blank canvas that's 1024x768 and copy the background image to the top right corner and save it as a gif file. :p
Dusty
September 8th, 2001, 10:14
i always take the <body> html code that's the easiest one
and if netscape doesn't see it? well that's bad for them."I'm sorry, but IE's proprietary:
<body ... bgproperties="fixed">
Is quicker to write than the standard:
<style>
body{
background-attachment: fixed;
}
</style>
Not my problem that I'm lazy, it must be your browser's"
:rolleyes:
i don't do anything about it. the most part of visitors of my site has IE so why should i build for netscape?My very favorite argument :D. Few non-IE users visit your site, so why bother yourself to try to write for anything besides IE? Say, has it ever occurred to you that possibly it's the other way around? That few non-IE users visit your site because you haven't bothered to make your site viewable to anything besides IE?
Dusty
September 8th, 2001, 10:18
In that case, to prevent it from tiling, create a new blank canvas that's 1024x768 and copy the background image to the top right corner and save it as a gif file. :pI said that already, Lex :p, but you would want to make it significantly bigger than 1024x768. You might get by with 1024 for the width (though I'd make it at least 1600), but you would want to make it much much taller, say 5000.
meow
September 8th, 2001, 12:08
Originally posted by LastActionHero
I always wanted to know how to do this? Meow how is it done in CSS?
You have to position the bg and then use "background-repeat: norepeat".You can also make it repeat only horizontally or only vertically. This can be expressed so may ways so I think you are better off reading than if I give you an example. :)
http://www.w3.org/TR/REC-CSS2/colors.html#q2
"fixed" stops it from scrolling but it still tiles. Makes me nauseous, that. :o
meow
September 8th, 2001, 12:38
Originally posted by Dusty
"I'm sorry, but IE's proprietary:
<body ... bgproperties="fixed">
Is quicker to write than the standard:
<style>
body{
background-attachment: fixed;
}
</style>
What's wrong with the standard <body style="background: fixed">? ;)
LastActionHero
September 9th, 2001, 02:04
Thanks Meow!
meow
September 9th, 2001, 02:21
You're welcome, LAH. ;)
LeX
September 9th, 2001, 07:49
Originally posted by Dusty
I said that already, Lex :p, but you would want to make it significantly bigger than 1024x768. You might get by with 1024 for the width (though I'd make it at least 1600), but you would want to make it much much taller, say 5000.
Oops, missed that post. :p
Powered by vBulletin® Version 4.1.7 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.