Can I use CSS for this?

6 replies
  • WEB DESIGN
  • |
What I want to do, in simple terms is to keep my header (which contains a certain graphic), the footer (which will have text in the form of a disclaimer about the products uses etc.) constant for all my webpages.
But I also want to be able to update my site and add additional links on the left-hand toolbar and not have to change all the links within all my other exisiting HTML document to do this. Can CSS achieve this? That's all for now.

Peter


P.S Sorry if my description is a little vague, but I have to go now, for further details you may PM me or we can have a messenger chat
#css
  • Profile picture of the author miellas
    If I understand correctly, u would want to just have to update the rotating links in the left or any area where u prefer to make link changes to? If were on the same page, I would recommend just adding a database to your mysql exclusive to your links you want rotating everytime your page is refreshed. Hope this helps
    {{ DiscussionBoard.errors[1618572].message }}
  • Profile picture of the author Lloyd Buchinski
    CSS won't do it.

    It sounds like you are looking for is PHP includes. You can use just one file for your navigation and just put the PHP include in the navigation area of your html sheets. Then when you add a link to your navigation.php file it adds the same link to the nav on all your pages.

    An extra little problem is that you won't be able to use .html for the file extensions any more, you will have to change your pages to .php.
    Signature

    Do something spectacular; be fulfilled. Then you can be your own hero. Prem Rawat

    The KimW WSO

    {{ DiscussionBoard.errors[1618627].message }}
    • Profile picture of the author CarloD.
      Ya Here's what I would do,

      .... any html file you can rename to php.... Even if you don't use any PHP in them. That being said.

      I would have 3 includes

      header.php
      nav.php
      footer.php

      content-page-1.php (this would hold all body content)


      Folder Structure:
      (public_html)
      content-page-1.php
      content-page-2.php
      ...
      (inc (Include folder to hold Header/Footer))
      header.php
      nav.php
      footer.php

      (Images folder)
      ....




      header.php

      Code:
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
      
      <head>
          <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
          <meta name="author" content="test1" />
      
          <title>Untitled 3</title>
      </head>
      
      <body>
      footer.php
      Code:
      </body>
      </html>
      Content Page
      Code:
      <?php
          include ("inc/header.php");//Call the header from include Folder
          include ("inc/nav.php");//Call the nav
      ?>
      
      
      <!-- HTML here -->
      
      <?php
          include ("inc/footer.php");//Call the footer
      ?>

      now depending how your site is built... you may need to do some work...

      As for CSS, you could use that to layout your page.
      Signature

      {{ DiscussionBoard.errors[1620027].message }}
      • Profile picture of the author SEO_Pro
        You could also have php do the opposite.
        Have one page and then have content in different files.
        The links will have variables for example: index.php?p=contact

        In your index.php you would have something that checks the variable is there so you could use isset() function. Then if that comes true you will display the page based on the variable. Also make sure you have a prefix or your includes will be unsecure.
        {{ DiscussionBoard.errors[1620170].message }}
        • Profile picture of the author Peter Nguyen
          okay yeh i got the php includes to work thanks

          Edit: the php include functions appear to be working okay in dreamweaver, yet when i do a browser test the nav tool bar, top and bottom ones seem to be missing
          {{ DiscussionBoard.errors[1622696].message }}
          • Profile picture of the author Peter Nguyen
            all cool i tried uploading the php files to a free webhost and they turned out perfectly
            {{ DiscussionBoard.errors[1623100].message }}

Trending Topics