Jul 24, 2008

Fixed Background - easy

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > HTML, XML etc..

free web hosting

Fixed Background - easy

doomforge
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 ohmy.gif
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

Reply

jlhaslip
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.

Reply

ETCZ
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.

Reply

matak
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..

Reply

hts
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 wink.gif

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Recent Queries:-
  1. fixed background in middle - 28.81 hr back. (1)
  2. how do i make a fixed backround with my fixed backround in the middle - 50.52 hr back. (1)
  3. "body background=" fixed - 90.97 hr back. (1)
  4. background resolution fixed html - 92.43 hr back. (1)
Similar Topics

Keywords :

  1. Background Question
    :) (12)
  2. Ok Background Help Please
    html (4)
    OK so i've given up on the paint for background now how would i get it to look like this
    http://img.photobucket.com/albums/v614/Dj1.../background.jpg without using paint and without it
    coming out to look like this... http://img.photobucket.com/albums/v614/Dj169211/Damn.jpg like,
    with just html code, not trying to use paint and do the BS any ideas?....
  3. Help With Background Image
    please? :) (6)
    Ok heres the scoop, i got a background that i made in paint for my website its just like 3 lines for
    the nav bar, banner and other things ect. ect. now when i hosted it on a site and put in the This
    is what it looks like in paint http://img.photobucket.com/albums/v614/Dj1.../background.jpg and
    this is what it looks like when i put it into HTML
    http://img.photobucket.com/albums/v614/Dj169211/Damn.jpg i dont want it tiled like that so is
    there any way that i can change that? any ideas? :| Thanks in advance /smile.gif"
    style="vertical-align:middle" emoid=":)" borde....
  4. Background Image Picture On A Website
    how do u make a pic a backround?? (3)
    ?email me if u know! Trap17 forum asks you to post contributes with substance. ....
  5. Usemap And Table Background Image Changing
    (5)
    I have a menu page that consists of links to other pages. The page has a background image of a
    globe. The globe is divided into seperate sections for each menu item. As a user hovers over each
    section I change the background image(The same globe with that section highlighted.) That is what I
    have so far except that they have to hover over a small anchor tag that I put in not the whole
    section. I want to change it so that they can actually hover over all of the section they are
    selecting. I found usemap online but haven't found any examples where it will actually ch....
  6. Fixed Background Image
    Just little reminder (10)
    Easy teahnic, post the following codes between and QUOTE <!--
    body{background-image: url( under.gif ); background-repeat:no-repeat; background-attachment :
    fixed; background-position: 10% 20% ;} --> For red colour, change it to your
    image's location. For green colour, it is used to set horizontal and vertical position of
    background image. I hope it can help you. /tongue.gif' border='0' style='vertical-align:middle'
    alt='tongue.gif' /> ....
  7. Background Resize
    (4)
    Does anyone have the javascript for a background to resize? I want my background to resize to
    1024x768 if the visitor has resolution 1024x768, to 800x600 if the resolution is 800x600 etc.
    Greets, ExplosioN /smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /> ....
  8. Background Fit Any Resolution
    hmmm (6)
    Is it possible to do with html. I have found a few solutions but they dont seem to work. I know it
    is possible in java. But anyone have the code for html? Would really appreciate it.....
  9. Background Not Big Enough
    (4)
    Hi: Ok, first off....moderaters, please move this topic to the appropriate category. I really
    couldn't find a spot to put this in...so I just picked one. Here is the page I have a question
    about: http://histology-world.com/articles/article9.htm The problem? Scroll down and you can
    see. My background image is not long enough. I have gone into my photo editor and readjusted it,
    just made the canvas size larger. But then I am starting to get concerned about file size. I want
    the lights at the top. When the background image repeats itself, the lights are ins....

    1. Looking for Fixed, Background

Searching Video's for Fixed, Background
advertisement



Fixed Background - easy



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE