Hi, i'm new to the forum and new to CSS. I have a basic working knowledge of html and C++...and i'm building a new site - www.fallingdragon.com , what i want to do is write a nav section or navbar or something of the sort, and have it inserted into every page of the site, without having to write it out in every page....so i dunno if i can make a Function of sorts like in C++, or ...i dunno what to do.
uhh...CSS equivalent to C++ functions?
Not sure if you can do it with CSS alone, but does C++ have an include funtion?
I code in PHP and I can
<? include 'Navbar.php' ?>
within a page and it will put the Navbar.php page where ever I placed the code.
ASP has this funtion to I think. Hope this helps
Josh
uhh...CSS equivalent to C++ functions?
in C++ i could do something like...write a function in an external file... for example...
void Nav()
{
(nav bar code here)
}
and then in the main file i just would have to write
Nav();
and whatever is in the function will be run, i think there is another name for this...encapsulation..or something. Just an easy way to reuse the same code.
uhh...CSS equivalent to C++ functions?
Not sure if you can do it with CSS alone, but does C++ have an include function
if i for example made an external file that had all my functions and classes in it...like 'Stuff.h'...i would go into the program and write #include "Stuff.h" and all classes and functions would be inherited by the program.
uhh...CSS equivalent to C++ functions?
If you're well versed in C++ Javascript wouldn't be much a of leap fo you, if you were wanting to make an interactive nav-bar that sorts it's content dynamically.
I still use dreamweaver and it's template system for maintaining congruent content across a site.
It's basically a glorified find/replace that checks and replaces content outside of dreamweaver specific comments like
<!-- TemplateBeginEditable name="Stuff1" --> This is the stuff that stays the same. <!-- TemplateEndEditable -->
So it essentially finds/replaces the structure of the page without interfering with the content.
The opposite to this are Lirbrary items which are unique things like navbars etc that get replaced when dreamweaver spots similar style tags.
Dunno, if you're looking for simplicity, try out Dreamweaver with it's template system for keeping your pages in check, or like homchz suggested, if you have any kind of scripting on your server like ASP / PHP / Perl you could include nav bars/footers/headers etc as the page loads, all from the server, which would only mean changing/uploading one file
Up to you, whatever at the end of the day, works out the easiest route.
uhh...CSS equivalent to C++ functions?
If your server supports SSI (Server Side Includes), you should be able to try one or the other of these examples...
<!--#include file="nav.txt" --> or <!--#include virtual="nav.txt" -->
This simply inserts the requested document within the html. You may typically have to figure the preferred language, like .asp, .php, .cfm, etc. Otherwise, your document could just be "nav.html".