PDA

View Full Version : Opening nav menu content in main content column


lee69
Apr 20, 2008, 12:58 AM
You will have to excuse me because I am quite new to CSS. I am trying to create a personal website using style sheets - with a basic two column layout with a header and footer. I have created the elements of the front page and have the navigatin bar on the left (Home, About me, etc) but I am unsure how to code it so that when one of the links on th nav menu on the left is clicked - it will open the page in the central column (main content column) without removing the nav bar menu/header and footer.

I seem to be fine getting the first page up and running, just getting lost when I attempt to link to additional pages.

Basically want my site to open everything in the main content window - keeping the menu's on the left all the time. Like the following site does:

24houhtmlcafe.com (http://24houhtmlcafe.com/)


Any help would be appreciated

robertva
Apr 23, 2008, 09:59 AM
You could use Javascript to change the source property of a HTML "frame" within a "Frameset". It's possible to nest one frameset within another to obtain the combination of header and footer with a navigation menu on the left. See a narrative with examples at DOCUMENTATION - All HTML-TAGS & BUILT-IN JAVASCRIPT OBJECTS (http://www.echoecho.com/documentationframe.htm?html40/present/frames.html#edef-FRAMESET)

An alternative would be to use a HTML "IFRAME" DOCUMENTATION - All HTML-TAGS & BUILT-IN JAVASCRIPT OBJECTS (http://www.echoecho.com/documentationframe.htm?html40/present/frames.html#edef-IFRAME)

Both of these HTML tags have alignment and float properties you can set with inline or external styles. Theoreticaly some browsers don't support framesets and/or iframes, but a large majority of visitors will probably be using browsers that are compatible with those tags.

The index for the reference linked to above is at EchoEcho.Com - HTML tag Reference (http://www.echoecho.com/htmlreference.htm)

retsoksirhc
Apr 23, 2008, 10:52 AM
Nice suggestion, robert.

You can also use javascript to change the source of a DIV. I've only just started working with DIV's so I'm not sure exactly how you would accomplish this, but I'm pretty sure you could do it... I just don't know how to align them.

For reference, the javascript property innerHTML is the one you would use to change the HTML source of the div.


For menu's I usually just write the page up with regular ol HTML, even if it includes some CSS. I usually use tables, though... the menu goes in one cell, the page in another. If you put the menu in it's own file, and you have accses to PHP, you can just do an include(); on the menu script and all is well.