1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

How to use a cascading style sheet on a site

Discussion in 'General Internet' started by shadowhawk, 2004/02/15.

Thread Status:
Not open for further replies.
  1. 2004/02/15
    shadowhawk

    shadowhawk Inactive Thread Starter

    Joined:
    2002/01/07
    Messages:
    985
    Likes Received:
    0
    I'm helping a friend build an anime website and she downloaded this background package that includes 2 JPEGs and a CSS. Do I need to upload the CSS file and the updated INDEX.HTML to the server along with the JPEGs? Do I need to modify her INDEX.HTML to point to the CSS or to the 2 JPEGs as her background?
     
  2. 2004/02/15
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    Add this in the <head> of the document:

    <LINK REL= "stylesheet" TYPE= "text/css" HREF= "file_name.css" />

    Change file_name.css to the actual name of your .css file and upload the index.html & file_name.css. The .css can be in any directory so long as the correct path is used in the LINK REL tag.

    re the images:
    Yes, they too must be uploaded. Inspect the .css file for the location of the images. I take it they are bg images, therefore there will be a line similar to this:
    body {background-image:url( "/images/file_name.jpg ")

    Note the path used in the css code. The path must reflect the location of the images on the server. The images can be anywhere so long as the correct path is used in the css code.
     
    Last edited: 2004/02/15

  3. to hide this advert.

  4. 2004/02/15
    shadowhawk

    shadowhawk Inactive Thread Starter

    Joined:
    2002/01/07
    Messages:
    985
    Likes Received:
    0
    That's kinda what I thought, but wanted to be sure. Thanks.
     
  5. 2004/02/15
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    Unless the .css file has many different things in it, such as styles for all other elements of the page, then it's just easier to put the bg css code in the document itself and eliminate the .css file completely:


    <STYLE TYPE= "text/css ">
    /*BODY PROPERTIES*/
    BODY {xxxxxx: yyyyyy;}
    </STYLE>
     
  6. 2004/02/15
    shadowhawk

    shadowhawk Inactive Thread Starter

    Joined:
    2002/01/07
    Messages:
    985
    Likes Received:
    0
    OK forgive my stupidity, but would that tag go at the beginning or end of the INDEX.HTML file?
     
  7. 2004/02/15
    leeleeleelee

    leeleeleelee Inactive

    Joined:
    2003/12/09
    Messages:
    105
    Likes Received:
    0
    Short answers: Yes and Yes.

    Long answer: Go here.

    Edit: Sorry TonyT, I took too long to post. You got in before me with very good answers. I just had a link to a CSS tutorial.
     
    Last edited: 2004/02/15
Thread Status:
Not open for further replies.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.