Question:
I need A CSS menu for my HTML website.?
pro1
2008-02-02 16:48:05 UTC
I have a personal HTML website and I need a CSS menu or something so that when I add a page or get rid of one I don't have to go in and change every page one at a time. Any ideas?
Four answers:
samhainthirteen
2008-02-02 17:00:44 UTC
You'll be needing some server-side scripting for auto-generating your menus, like PHP or Python.



CSS is only a styling language. It doesn't have the functionality of exploring your directories to find out what files are in them.
GEODE
2008-02-02 19:35:09 UTC
Cascading Style Sheets menus are becoming a very popular replacement to the traditional methods (e.g., tables with hyperlinks and buttons).



There are several different websites out there that I have used personally for my business and personal websites. A good source is http://www.dynamicdrive.com/style/ or http://cssmenumaker.com/



Another source, which has free premade CSS website templates is http://www.openwebdesign.org/ where you can use the entire website, or just copy and paste the menu portion into your existing web site html code (be sure to give the designer a credit at the bottom of your web page though!)



Now, in order to make it so you don't have to copy and paste the CSS code into every new web page you will need to create an include file with the CSS code embedded within it. If you don't know how to do this, I recommend going to a site such as http://www.hardcoder.com/scripting/php/include_files.php#why

You will need to prepare to learn a bit about PHP (hypertext preprocessor) server-scripting. There are plenty of services out there that can help you learn about that, such as http://www.php.net



Otherwise, your other option is to copy one of your preexisting web pages with the CSS code in it, rename it as "template.html" and use this to make new pages without having to worry about recreating a new page every single time from scratch.



Good luck and have fun!
Spearfish
2008-02-02 16:53:46 UTC
Well search for "drop down menu" and you'll find a nice menu system.



Anyways, you can't use CSS to modify every page at once. The easiest way to do this is by making an include system using PHP. Look into that.
sue
2016-05-24 04:43:02 UTC
Most designers include those in header files that are referenced on every page. If you are using a CGI (php, perl, python, ruby) then you can make a function like left_menu() and call that to output the menu where needed. Also CGI frameworks like PHP's codeigniter has template systems that make things like that very easy.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...