Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    Jul 2006
    Posts
    2
    Member #
    13525
    I have a website with multiple pages and they all share the same navigation bar on top. Instead of having updating each html for the navigation bar, how can I use css to make the top navigation bar easily updated in the future with a separate html file? Please help!

  2.  

  3. #2
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    CSS can't do this, but SSI can, as well as many scripting languages like PHP and ASP. Server support is required for all of these, however.

  4. #3
    Junior Member
    Join Date
    Jul 2006
    Posts
    2
    Member #
    13525
    Quote Originally Posted by Shadowfiend
    CSS can't do this, but SSI can, as well as many scripting languages like PHP and ASP. Server support is required for all of these, however.
    Can you show me any scripts that can do this?

  5. #4
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    ASP's includes work exactly the same way as SSI ones do:
    HTML Code:
    <!--#include file="whateverfile.html"-->
    PHP scripts are similarly simple:
    PHP Code:
    <?php include( 'whateverfile.html' ); ?>

  6. #5
    Senior Member karinne's Avatar
    Join Date
    Dec 2003
    Location
    Aylmer QC Canada
    Posts
    1,607
    Member #
    4335
    Liked
    8 times
    If you are not and don't plan on using PHP or ASP (or any other server side language) I suggest going to the SSI route.

    Let's say this is your original page
    original.html
    HTML Code:
    <html>
    <head>
      <title>This is a title>
    </head>
    
    <body>
    
    <div id="menu"> some menu here</div>
    
    <div id="content">content in here</div>
    
    </body>
    </html>
    Let's say that <div id="menu"> will not change between page so you strip that div of original.html and you now have

    menu.html
    HTML Code:
    <div id="menu"> some menu here</div>
    original.html
    HTML Code:
    <html>
    <head>
      <title>This is a title>
    </head>
    
    <body>
    
    
    
    <div id="content">content in here</div>
    
    </body>
    </html>
    Now ... rename original.html to original.shtml and add <!--#include virtual="menu.html" -->

    original.shtml
    HTML Code:
    <html>
    <head>
      <title>This is a title>
    </head>
    
    <body>
    
    <!--#include virtual="menu.html" -->
    
    <div id="content">content in here</div>
    
    </body>
    </html>
    and you're done. BTW ... make sure your host supports SSI
    [a web design portfolio - Currently NOT AVAILABLE for work | web design | Re-coding | PSD-to-HTML]
    I'm also on: virb - facebook - twitter - flickr - del.icio.us

  7. #6
    Senior Member minute44's Avatar
    Join Date
    Mar 2006
    Location
    Nottingham, UK
    Posts
    264
    Member #
    12849
    CSS can change the appearence of your navigation and it's position on the page but as for the contents, i.e. the text, SSI is the way to go. If you're using Dreamweaver there could be a way to use library items to accomplish the same effect but knowing DW it would probably mess with yuor code.
    No ma'am, we in IT don't have a sense of humor we're aware of.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 03:09 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com