Quick CSS Tip: Backgrounds
If you ever wanted to apply more than one background image into your web page, this one’s for you. I’ve stumbled upon many sites that use various techniques, such as nested DIV’s, to combine two or more images into the site background. A quick and simple solution is to style both the HTML and BODY tags. This very site has been using that very technique for a while now. Check out the example.
A good one, Bojan. I guess this comes most useful when you have two different tiles on both x and y axis.
Alen on November 3, 2005
It can be useful in many, many situations. It’s all up to one’s imagination, I guess :)
Bojan on November 3, 2005
Imagination and thinking outside the
box<body> are what CSS is all about. :)Jason Beaird on November 4, 2005
Thank you for this idea. It is so simple and brilliant that I am devastated I could not work it out myself.
Victoria Pavlova on February 1, 2006
it is all good, unless you do a crossbrowser test :(
I’ve tested this with different versions of IE along with different other browsers.. and not all of them are reading the background image for the html tag..
i couldn’t even get IE 5.5 to read the image. and there are still a couple of those around..
Even Mozilla 1.6 and some versions of camino couldn’t read it..
so i guess i’ll stick to the extra div boxes.. they still work cross browser and platform..
but nicely done though..
Steen Nielsen on February 3, 2006
Your web site is great congratulation
jan on February 3, 2006
It`s a good tip to remember the html and body tags…
ANGEL on February 18, 2006
[...] t off. Alright, so let’s try a different approach. I googled around a bit and found this hack. It appears that most browsers will recognize the bac [...]
Pingback When modern browsers disagree on September 15, 2008