Okay, quick question. What is the necessary code to keep a background still while the user scrolls up or down? I have a 1x700 px top to bottom gradient image in the background, and I don't want it to tile heigth wise.
Thanks,
Mark Barnett
the_pm
03-16-2005, 03:28 PM
{ background:url(path/file.ext) top repeat-x }
easy as pie :)
okay does that go into the CSS? this is what already exists:
body {
background-color: #181818;
background-image: url(images/bg2.jpg);
}
the_pm
03-16-2005, 05:39 PM
body {
background: #181818 url(images/bg2.jpg) top repeat-x;
}
^^ That's the CSS shorthand version above. CSS shorthand is very handy! That should do the trick.
That didn't QUITE get it. I would like to keep the background still while I'm scrolling down the page so that it doesn't repeat itself below and show a nasty white to black transition within 2 pixels.
If that isn't possible, is their a way I can mirror the image on a horizontal axis?
Thanks,
Mark Barnett
the_pm
03-17-2005, 11:08 PM
That was the best guess I had, going off your description alone. Can you post a link to a test page?
Maybe you just need to add 'fixed' into the rule. Maybe that's what you're trying to do:
body {
background: #181818 url(images/bg2.jpg) top repeat-x fixed;
}
But again, without seeing the problem, it's just a guess ;)
Website Rob
03-18-2005, 12:51 AM
I've found it works best when 'repeat' is stated by itself.
body {
background: #181818;
background: url(images/bg2.jpg);
background-repeat: repeat-x;
}
There are some Browsers (and IE will be named here ;)) that do not work well with certain CSS code - even though most other Browsers do not have a problem.
the_pm
03-18-2005, 12:57 AM
Rob, what version of IE? I've found that IE5, 5.5, 6 and 5.1/5.2 for Mac all recognize shorthand. Are you talking about earlier versions? I've actually never written out a set of background styles on a site in my life - I've always used shorthand. If I've goofed something up, this is as good a time as any to find out! :)
Website Rob
03-18-2005, 01:28 AM
I found out with IE 5.01 that short-hand CSS was very wonky. So I switched to doing some CSS in full code. May not be the case now but I know how some code (of any language) needs to be dumbed down for almost any version of IE.
There is one flaw the really burns my butt because I use it a lot and todate, no version of IE handles it properly. Even got to the point where this particular bug now has it's own name: Peek-a-Boo bug (http://www.positioniseverything.net/explorer/peekaboo.html). The same site has lots of other good info on various IE bugs as well. Highly recommended for those of us with less hair now, due to IE and proper coding. :D