Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jan 2003
    Location
    NZ
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    background images

    Hello I'm pretty new to this forum, need help on images and stuff basically how to insert them as background images in websites. The actual code would help. Is it possible to reference an image without sourcing it. eg "e:\images\bg.gif"? is it possible to omit the drive where it is located and if so how?
    Last edited by rjkd; 01-11-2003 at 02:50 PM.

  • #2
    ivy
    ivy is offline
    Regular Coder
    Join Date
    Jun 2002
    Location
    London / Glasgow / Liverpool
    Posts
    177
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hi rjkd

    The best way of doing this is to use CSS.

    You will need to put the following bit of code within your <head> </head> tags:

    Code:
    <link rel="stylesheet" href="theCSSfilename.css" type="text/css">
    Then you need to use the following code and save it as theCSSfilename.css:

    Code:
    BODY { BACKGROUND: #99CC33 url(images/theIMAGEfilename.gif) no-repeat fixed center center}
    In actual fact, you should perform the above two tasks the other way around! But hopefully you get the idea.

    Change "theCSSfilename.css" to whatever you want, so long as you keep it suffixed with .css
    The same goes for "images/theIMAGEfilename.gif".

    The above code keeps the image in the centre of the page always - that is, it doesn't scroll, it just stays put (fixed).

    There is a javascript for doing this too which you can put within the html.

    The best way is to make the css file as you can then add other styles to your web pages. Also, as it is calling styles from an external file, you can change your web page styles all at once by changing one file as opposed to changing many pages which is very time consuming.

    Hope this helps.
    See ya

    Ivy.

    MAC Codes

  • #3
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    rjkd

    If you are new to the wonders of creating a web site I suggest you take it one step at a time.

    CSS allows you to do far more and have a greater control over your page contents.

    Whilst CSS is the way you will be going you need to have an understanding of HTML first.


    To colour the background you add bgcolor=" " to the opening body tag

    <body bgcolor="red">

    To have an image as the background you add background=" " to the opening <body> tag

    <body background="Your Image.jpg">

    You do not put the drive letter for the internet use.

    For more information on the basics see


    http://www.huntingground.freeserve.c...sics/intro.htm
    Last edited by Mr J; 01-11-2003 at 03:19 PM.

  • #4
    New to the CF scene
    Join Date
    Jan 2003
    Location
    NZ
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hey thanks for the help guys. I've done a website project before the thing is I don't have my references with me. Tend to forget even the basic stuff too .


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •