...

View Full Version : Help adapting css menu



nooknmook
08-21-2005, 03:05 PM
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 -->

vwphillips
08-21-2005, 08:08 PM
<!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 ????????

rmedek
08-22-2005, 02:51 AM
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.


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>




<body>

<?php include("nav.php"); ?>

</body>

nooknmook
08-24-2005, 11:50 AM
was wondering if there was a client-side solution really?

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

martin_narg
08-24-2005, 12:35 PM
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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum