#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    3
    Rep Power
    0

    Basic nav menu help


    When i have a change (add or delete an item) in my nav menu on my website, i want to be able to change it in one place and it changes all of the pages.

    I have my website set up now so that each html web page has the nav menu so i have to go in to each page when the nav menu changes.

    I think you can set it up so you go to one file to change your nav menu and then it changes on each page automatically.

    I am very new to this so i am trying to grasp this and make it efficient at the same time!

    Thank you!
  2. #2
  3. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,131
    Rep Power
    4304
    Welcome to DevShed Forums, Sadie756.

    CSS is used to style menus, but to control what links are in each page, you need to use a server-side language, like PHP. Check out this tutorial on how to use PHP includes.
    Spreading knowledge, one newbie at a time.

    Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    3
    Rep Power
    0
    I don't think i am clear in my question, when you create a website and you create a horizontal nav menu in an html webpage you are working on, index.html or whatever, you enter the css code at the top of each .html page so that the .html page knows where to get the css style AND you have to enter the html code for the nav menu in EACH page -right? if that is the case, how does one who has a website with 25 pages, change, add a product to or revise the nav menu efficiently without going in to each of the 25 pages to change the nav menu?

    for some reason i cannot get to your link. i will keep trying!
    Last edited by Kravvitz; April 23rd, 2013 at 08:02 PM. Reason: removed unnecessary quote
  6. #4
  7. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,131
    Rep Power
    4304
    Do you mean that all of your styles are in a <style> element in each page? If so, external stylesheets are much more efficient.

    Typically, for small sites, an external stylesheet is used for the common styles for all of the pages and a server-side include is used to include common page sections (main navigation, footer, etc.) in each page. In case you are curious, larger sites typically use complex content management systems (CMS).

    Ah. I didn't check to make sure the link was working. You can view an archived copy here.
    Spreading knowledge, one newbie at a time.

    Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    3
    Rep Power
    0
    [QUOTE=Kravvitz]Do you mean that all of your styles are in a <style> element in each page? If so, external stylesheets are much more efficient.

    Typically, for small sites, an external stylesheet is used for the common styles for all of the pages and a server-side include is used to include common page sections (main navigation, footer, etc.) in each page. In case you are curious, larger sites typically use complex content management systems (CMS).

    Thank you!!! PHP Includes is EXACTLY what i wanted! Thank you so much for your help!!!

IMN logo majestic logo threadwatch logo seochat tools logo