Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Aug 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Help adapting css menu

    HELP!?!?

    i have a menu created using css and a list of <a> tags within the html, using the class within the css to define the structure.

    But of course this way, when updating my menu (adding or removing items) i have to manually add or delete the item in the html code.

    Is there a way of having an external document to house the data needed in the list and then referencing it on every page?

    Help!?!?

    code snippet:
    ------------------------
    <table width="120px" align="center">
    <div id="coolmenu" class="coolmenu">
    <a href="home.htm">Home</a>
    <a href="fixtures.htm" target="_blank">Fixtures</a>

    <!-- and so on -->

  • #2
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,466
    Thanks
    3
    Thanked 495 Times in 482 Posts
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
    
    <html>
    
    <head>
      <title></title>
      <link rel="stylesheet" href="mystylesheet.css" type="text/css">
    </head>
    
    <body>
    
    </body>
    
    </html>
    put your style classes in a text document 'mystylesheet.css'


    or did you want a JavaScript solution ????????

  • #3
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    But of course this way, when updating my menu (adding or removing items) i have to manually add or delete the item in the html code.
    Server-side includes. There's an option for pretty much every type of scripting: asp, php, shtml, etc.
    Code:
    nav.php
    
    <ul id="nav">
      <li><a href="#">link</a></li>
      <li><a href="#">link</a></li>
      <li><a href="#">link</a></li>
      <li><a href="#">link</a></li>
      <li><a href="#">link</a></li>
    </ul>
    Code:
    <body>
    
    <?php include("nav.php"); ?>
    
    </body>

  • #4
    New to the CF scene
    Join Date
    Aug 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    was wondering if there was a client-side solution really?

    I hate to be difficult, but there must be a way

  • #5
    Regular Coder martin_narg's Avatar
    Join Date
    Jul 2002
    Location
    Chamonix, France
    Posts
    600
    Thanks
    1
    Thanked 3 Times in 3 Posts
    Client-side refers to code that is interpreted and processed by the users browser, server-side refers to code that is interpreted and processed by the web server.

    As the styling is something that is interpreted and processed by the user's browser it is client-side and vwphillips post is the one you require - as you wish for a client-side solution.

    Some info:
    http://en.wikipedia.org/wiki/Client-side
    http://en.wikipedia.org/wiki/Server-side

    Hope this helps.

    m_n
    "Cos it's strange isn't it. You stand in the middle of a library and go 'Aaaaaaaaaaaaaaaaggggggghhhhhhh!'
    and everybody just stares at you. But you do the same in an aeroplane, and everybody joins in."
    -Tommy Cooper


  •  

    Posting Permissions

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