Thread: CSS Help

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    6
    Rep Power
    0

    CSS Help


    Is there a way to have the *.css to include a text block. What I want to do is have my address appear at the bottom of every page. Above the address I also want a blue line that is 590 pixels long and 1 pix thick. At the top of the page I would like to also have a pic to appear. If anyone has some suggestions thanks,

    Tony
  2. #2
  3. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2003
    Posts
    804
    Rep Power
    101
    I do not know how to do it in CSS or if it is possible, but a javascript include would be one workaround... use document.write() to output the text block, save the script with a .js extension, and at the bottom of your pages put:
    <script type="text/javascript" src="filename.js"></script>
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    6
    Rep Power
    0
    That would every page that I create to have the same pic at the top, the blue line and my address at the bottom?
    Thanks,
    Tony
  6. #4
  7. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2003
    Posts
    804
    Rep Power
    101
    To put a pic at the top, you would probably have to make separate script, unless you positioned it absolutely, in which case you would need to make sure it was not going to cover up something... but yes, if logo.js was this:
    Code:
    document.write("<img src='logo.jpg'><br>");
    you could put it in your page with this...
    <script type="text/javascript" src="logo.js"></script>


    Alternately, you could make something like includes.js and have it be like this...
    Code:
    function logo() {
      document.write("<img src='logo.jpg'><br>");
    };
    
    function footer() {
      document.write('<hr style="color:blue;height:1px;width:590px;" align=left>');
      document.write("This page was created by somebody!");
    };
    Then in your document head...
    <script type="text/javascript" src="includes.js"></script>

    And at the top and bottom of the page, call the functions you defined:
    Code:
    <body>
    <script type="text/javascript">logo();</script>
    ...
    <script type="text/javascript">footer();</script>
    </body>
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    6
    Rep Power
    0
    The advantage of css is that I can make a change to the one file and not have to hit every page. I have around 30-40 pages that would need to be changed everytime a changed needed to happen.
    Thanks,
    Tony
  10. #6
  11. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2003
    Posts
    804
    Rep Power
    101
    The script tags would have to be put in every page, but editing the .js file would affect each page. So the script does have the same advantage... the disadvantage is that you have to put the new tags in... whereas you probably have the .css file already.
  12. #7
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    6
    Rep Power
    0
    In the top pic in need to either embed links of through the script have the links placed. How do i do that??
    Thanks,
    Tony
  14. #8
  15. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2003
    Posts
    804
    Rep Power
    101
    That would be an image map. Do a web search for "image map"... one page that gives a demonstration is http://www.htmlgoodies.com/tutors/cs_imap.html -- but you could find scores of other tutorials most likely.

IMN logo majestic logo threadwatch logo seochat tools logo