CSS Examples Fixed and centered background image
Author: CSS Drive
This example demonstrates using CSS to create a watermark background image for the page, whereby the image is centered and non repeating.
Example: n/a.
CSS Source Code:
<style type="text/css">
body{
background: url(background.gif) white center no-repeat fixed;
}
</style>
Comments (26)
Super nice, super easy, super good looking. Just wanted to tell you in case you don't know ;). Thanks!
hi just want to try how this thing would work..
looks delicious
vut it seems like I'm too stupid to correctly insert the image url :|
what is the correct way ? [/embarrass mode]
from my web site:
background: #fff url(/img/bg_bigtt.jpg) 30% 50% no-repeat fixed;
or for centered
background: #fff url(/img/bg_bigtt.jpg) center no-repeat fixed;
the forward slash in the image path ensures that it will map correctly to the proper file/folder regardless of where it is called from. And just out of habit I always declare the bg color 1st but according to the example given here apparently it doesn't matter.
Thank you,
Jim S.
http://tentonweb.com/
Jacksonville, Florida USA
Just a semi related issue:
I've got a css code(page) that enables the bg image to be 'expandable' ie fits all screen sizes.
I have also got a page that has all the relevant css codes for menu links etc.
The prob is that the 2 pages of are incompatible(?).
The first page does'nt have the Doc type specified at the top at all,the second page needs the doctype specified- when I insert the relevant code from first page it does'nt seem to display the bg image at all.
So,to simplify..
I need the bg image code(from 1st page)inserted into the 2nd page that has the doctype specified-by doing this it throws a hoofy(!?) no image is displayed.
Pink[panther
New Zealand-Porirua
can help me to insert custom cursor??
i can get the url, and insert it to my friendster, but it have no effect....
This is good places to create faboulous web...such a good places
You can't insert a custom cursor unless the .cur file is in the same directory as the page you're trying to use. At least I haven't seen it work otherwise...
I use a custom cursor for our studio's website, but again the .cur file's in the web root.
can u fixed it
please..I just wanna know how to fix my css profile, my problem is after I change my profile name, my customize profile are lost,and I tried many time to save my layout code to my css it was saving but it's not showing up to my porfile and I refresh it twise still not showing up...any Ideas??