|
|
|
|
![]() ![]() |
Dec 24 2006, 07:16 PM
Post
#1
|
|
|
Newbie [Level 1] ![]() Group: Members Posts: 15 Joined: 23-December 06 Member No.: 35,831 |
A while ago i was wondering how to make a fixed (static)* background and so i thought that other people might also want to know how to do it...the good news, it's a lot easier than you think
the code goes like this: HTML <body background="URL OF BACKGROUND IMAGE" bgproperties="fixed"> * a fixed or static background is a background that does not move while all the website content above it moves (ie text pictures etc.) an example would be some thing like this example web site so have fun giving your website some really cool effects |
|
|
|
Dec 25 2006, 04:28 AM
Post
#2
|
|
|
A computer once beat me at chess, but it was no match for me at kick boxing. ![]() Group: [MODERATOR] Posts: 3,968 Joined: 24-July 05 From: In Trouble Again... still? Member No.: 9,787 ![]() |
Here is a sample of CSS code that I use on a site to "freeze" a background gif at a specific location on the page. The gif is about 20 percent opaque, so it is really faint on the screen and it doesn't move when the page scrolls.
CODE body { background-color: #dfffdf; // set the colour for the page background-image: url('images/opac_logo.gif'); // select the image background-repeat: no-repeat; // no repetition of the image background-attachment: fixed; // fix the image on the page background-position: 50% 75%; // at this spot, play with it... } When I view your page, the image was repeated and didn't "freeze" itself on the page. If you want that to happen, feel free to borrow from the code I have posted. |
|
|
|
Jan 16 2007, 05:51 AM
Post
#3
|
|
|
Newbie ![]() Group: Members Posts: 4 Joined: 22-December 06 Member No.: 35,784 |
Well that is certainly a good bit of code you have provided and I wish to thank you for sharing it with the Forum membership. I had planned on learning this technique and now that I have found it here, I will be able to use it on the next version of my webite which I hope to get Hosted here at the trap17 Free Web Hosting service. As long as I am careful about posting non-spam postings and writing good quality posts, I should be abe to earn enough Hosting credits shortly, then I will have a nice fixed image on the background of my page.
This post has been edited by jlhaslip: Jan 16 2007, 06:35 AM |
|
|
|
Jan 16 2007, 02:16 PM
Post
#4
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 412 Joined: 4-October 06 From: Psychedelic Realms Member No.: 31,079 |
i kinda guess that this works for all backgrounds not only body?! and with that you can set background-position: 50% 75%; in pixels too.. haven't tried it, it's a wild guess..
|
|
|
|
Jan 16 2007, 10:52 PM
Post
#5
|
|
|
Advanced Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 138 Joined: 30-September 06 From: Iasi, Romania Member No.: 30,851 |
of course matak, in css you can specify sizes in: px, %, em (these are widely used)
also, you can define for any element a background learn css, it is a very powerful "tool" to build your site |
|
|
|
![]() ![]() |
Similar Topics
| Topics | Topics | |
|---|---|---|
|
|
|
|
Lo-Fi Version | Time is now: 29th August 2008 - 10:51 PM |