moving from frames & iframes to css divs and span - navigation help!

Associate
Joined
25 Oct 2002
Posts
1,707
in the past when ive dabbled with making a website ive used mainly frames, made the navigation easier as the link simply targeted the "main" section of the page.

however since frames are now out of fashion im trying to learn css and the div and span method. ive got a basic layout for my site but am unsure as how i can make the navigation part of the design work.

is it possible to have a link target the "main" div so that content is loaded from another page?
 
Associate
Joined
25 Oct 2002
Posts
1,707
i could do that yes and probably will in the meantime untill i figure out an alternative method (or fail!)

having the nav seperate from the content means creating, removing links easier no need to change the code on every single page, that and the fact its the way ive been used, comming from frames
 
Soldato
Joined
4 Nov 2003
Posts
5,733
Location
Edinburgh
Have the navigation link generate dynamically however you see fit, but thats making things complicated for little gain, how often would you change main/trunk navigation links? Why don't you plan your website first decide what you will need and just use them?
 
Permabanned
Joined
22 Apr 2007
Posts
1,805
Or create the navigation part as one complete image sliced up and define it in a CSS file. Then you just have to change the CSS file.
 
Soldato
Joined
6 Feb 2004
Posts
20,543
Location
England
if you've got php, you can use includes. eg

menu.php
Code:
<div id="menu">
<ul>
<li><a href="/blah.php">blah</a></li>
</ul>
</div>

now just include that file in every page like this....

Code:
<html>
<head></head>
<body>
<?php include 'menu.php'; ?>
<div id="content">
blah blah
</div>
</body>
</html>

you only need to edit the one file to update the menu in every page. :)
 
Top Bottom