I've worked with HTML for about a year now, and finally getting around to learn CSS. My question is, can I build a nav bar that will appear on every page using CSS? I have rollover CSS links, but I still have to copy those on each page. I hope to have a block of static code on my HTML docs that will load the nav bar from an off document source, such as my CSS styles sheet. Does anyone know how to do this?
This is not possible using CSS but you can do this with server side includes. In PHP it will be: <?php include("nav.inc"); ?> Code (markup): In HTML it will be: <!--#include file="nav.txt" --> Code (markup): Keep in mind that the page utilizing the include must end in .php if the include is in PHP or .shtml if the include is in HTML.
skateme just gave you the perfect answer. Personally, I'd design every page with a .php extension and try and learn a little more about php as you go. The include command can be used in many ways - you can minimise your work so much - include headers, menus, content - and when you get a lot of html, css and php knowledge - throw it all together you'll be able to include configurations such as cookies, logins, database connections. Basically - use this php include line - its handy and is the modern day version of html frames (in a way).