|
||
CATEGORIES Home Getting Started HTML Cheat Sheet Webmaster Tools HTML Help Forum Color Codes Link to us |
||||
Drop Down Menu's (Also known as Combo Box's) are a great way to organize a website. They allow you to place a large amount of link's into a a small area. If your wondering what a Drop Down Menu looks like, here's and example: Creating a Drop Down Menu is simple, to create one just copy and paste the following code to your website where you would like the Drop Down Menu to appear: <form name="gotolocation1" method="POST"> <select name="DDMenu" size=1> <option value="http://www.link1.com">Link 1</option> <option value="Http://www.link2.com">Link 2</option> <option value="http://www.link3.com">Link 3</option> </select> <input type="button" onClick="location = document.gotolocation1.DDMenu.options [document.gotolocation1.DDMenu.selectedIndex].value;" value="Go"> </form> This Drop Down Menu would look like this: To change the link's within the menu, just replace the information that is in black text with your own information.
If you want more link's, just add more <Option> code's to your script, for exmple:
Note: If you choose to have more than one drop down menu on your page, each Menu must have a DIFFERENT name. If you create 2 menu's with the same name you will get errors on your page. You can also change the color, size, and type of font, and the background color of your Drop Down Menu. You do this by using the Style Command. The only downside to this is, it doesn't display the color in ALL BROWSERS, so not all the people who visit your site will see color in your dropdown menu , most of them, but not all. Only Newer browsers like Internet Explorer and Netscape 4.0 and up will see the colors, everyone else will see the regualar colors of the drop down menu like the ones we made above. To add color to your Menu, just copy and paste the code below into the first <select> code in your script: style="font-family: comic sans ms" style="color: #003399" style="border: outset" style="font-size: 12" style="background: #003366" If you were to put this into your Drop Down Menu code your entire code would look something like this: <form name="gotolocation1" method="POST"> <select name="DDMenu" size=1 onchange="location.href=(form.DDMenu.options[form.DDMenu.selectedIndex].value)" style="font-family: comic sans ms" style="color: #003399" style="border: outset" style="font-size: 12" style="background: #003366"> <option value="0">Choose One</option> <option value="0"></option> <option value="http://www.link1.com">Link 1</option> <option value="Http://www.link2.com">Link 2</option> <option value="http://www.link3.com">Link 3</option> </select> </form> This Menu would look like this: <form name="gotolocation1" method="POST"> <select name="DDMenu" size=1 style="font-family: comic sans ms" style="color: #003399" style="border: outset" style="font-size: 12" style="background: #003366"> <option value="http://www.link1.com">Link 1</option> <option value="Http://www.link2.com">Link 2</option> <option value="http://www.link3.com">Link 3</option> </select> <input type="button" style="font-family: comic sans ms" style="color: #FFFFFF" style="font-size: 12" style="background: #003366" onClick="location = document.gotolocation1.DDMenu.options [document.gotolocation1.DDMenu.selectedIndex].value;" value="Go"> </form> This Menu would look like this: |