November 5, 200817 yr hello, Here's a question to be sure: how do I modularize CSS menus? In other words, I want to define a menu (e.g., SuckerTree Horizontal Menu) once, and then call/invoke it from any number of pages. Is this possible, or must I duplicate the HTML code in every page? Seems to me that last method would be inefficient, since a change to the menu would require a change to each and every page. Thanks http://www.infysolutions.com Outsourcing software development
November 5, 200817 yr I don't think css does that...it changes layout, style and background images not content. Somebody else may advise otherwise but I say: You can use php includes which are really very simple. Save the stuff you want to repeat on each page into a file called menu.php. Then type where you want it in your html page; <?php @include("menu.php"); ?> See this tutorial! Hope this helps
November 5, 200817 yr I don't think css does that...it changes layout, style and background images not content. Somebody else may advise otherwise but I say: You can use php includes which are really very simple. Save the stuff you want to repeat on each page into a file called menu.php. Then type where you want it in your html page; <?php @include("menu.php"); ?> See this tutorial! Hope this helps yes that is about the only means to do it, but you also have to remember any page that is including php has to be re-named from .html to .php.. so for example you would need to rename index.html to index.php also, the syntax is not <?php @include("menu.php"); ?> it is <?php include("menu.php"); ?>
November 5, 200817 yr Lol thanks ....I did wonder about that when I re-read the tutorial. I'm not sure where the @ came from. Sorry
November 5, 200817 yr the @ symbol tells php to not throw errors it the file doesn't exist! which is not a good idea for a novice rofl
November 6, 200817 yr Ah thanks I remember now....I did it so no errors would show on the page. Thanks
Create an account or sign in to comment