Results 1 to 5 of 5

Thread: Need Help With Stylesheet Pls

  1. #1
    Join Date
    Sep 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Need Help With Stylesheet Pls

    Hey, I'm working on a website for my family and relatives back home to share photos and videos...etc.

    I've found some really good scripts on this site that I've been trying out, so I was just wondering if its possible to add as much scripts into my stylesheet so I wouldn't have to add every scripts into every new pages I make.

    For example, all my pages are starting to look like this:

    In head section:
    <link rel="stylesheet" type="text/css" href="/stylesheet.css" />
    <script type="text/javascript" src="/menu_fade.js">
    </script>

    In body section:
    <body topmargin="0" leftmargin="0">

    (and the end of body):
    <script type="text/javascript">
    gradualFader.init()
    </script>

    Not sure if I'm not clear enough on what I'm talking about. Anyway, Ill be waiting for replies. Thanks.
    Last edited by djr33; 03-04-2011 at 03:57 PM.

  2. #2
    Join Date
    Apr 2009
    Location
    Cognac, France
    Posts
    400
    Thanks
    2
    Thanked 57 Times in 57 Posts

    Default

    Don't mix up CSS and javascript.

    You put your style in a css file, eg
    HTML Code:
    body {
    margin-top:0;
    margin-left:0;
    }
    You add the other styles you are going to use into this file.

    As to javascripts, you can put them all into the external file, but you will still need to call them in the appropriate place in your HTML.

    A way to ensure that you keep a consistent page look is to create a template document, ie a page that has all the basics in it - header/footer scripts, etc, and use that as the starting point for all of your pages.

    Hope this helps

  3. #3
    Join Date
    Sep 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    <link rel="stylesheet" type="text/css" href="/stylesheet.css" />
    The LINK tag is closed !!! (some tags do not need a closing tag, so the <script> is not within a <link> tag in your code.
    Last edited by djr33; 03-04-2011 at 03:56 PM.

  4. #4
    Join Date
    Sep 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Can someone else delete my post?

  5. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I have removed all instances of your domain name from your post (I am guessing this is why you want it deleted). However, it's best to keep old posts in case someone has a similar question.

    Note: using http://yourdomain.com/ or just / as the prefix for a path to a file is equivalent in almost all ways, so the code above will still work if someone would like to refer to it.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

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