CSS and drop down menus?

Discussion in 'Web Design and Development' started by RoboCop001, Apr 12, 2008.

  1. RoboCop001 macrumors 65816

    Oct 4, 2005
    Toronto, Canada
    Hey everyone.

    I'm just starting to learn about making drop down menus (using Dreamweaver) for a client, and I'm wondering if it's possible to link generic empty drop down menus to one single CSS so that the CSS tells the menu what to populate with (I'm guessing the CSS will point to an XML file?).

    Anyway, there's a lot of pages, 9 main sections plus subsections, and I don't want to have to build the drop down menus, and then copy and paste the code into all of the pages manually.

    There must be a way to make the basic empty menu and then have it dynamically populate with links right?

    All I want to do is have the basic empty menus on every page, and they'll all link to one CSS file, and the CSS file tells them what to show in the menu.

    That way, I only have to copy and paste the basic code for the menus to each page, and then I just have to add to the one CSS file.

    Or if it's not done using CSS, how would I do it?

    Any advice or pointing to tutorials would be highly appreciated. I just have so much to do, it'll take a long time to search and get the right information...

    So hopefully someone can help me out with a good tutorial link, or something. Anything! =)

    I just need a way that's not too difficult to make dynamic drop down menus.

    By the way, assume I'm a beginner in Web Dev (meaning HTML, CSS, javascript, all that)... because I am. lol...
    I'm really a Flash/Actionscript guy. But I don't think I should do it in Flash. It's a navigation bar.

    [sigh]... anyways. Thanks for any replies in advance =)

    There's a way to link an HTML to an external HTML isn't there? I think I remember it. But then, say I have my nav bar drop down menu code in a separate HTML file (that way I just need to copy the link code to all pages)... how do I get it to highlight the current section that you're in? It would need to display the appropriate "selected section state" of the button/menu.

    I'm starting to think all this falls under "advanced web dev"... I feel like I'm screwed. lol
  2. rhett7660 macrumors G4


    Jan 9, 2008
    Sunny, Southern California
    If you are using dreamweaver you won't really have to do the menus for every page. What I would do is this:

    Create your drop down menus. Depending on how you have your entire site laid out, you will have a library item for each section of the website. Then create library items for each page the drop downs are going to populate IE

    Page 1 menu 1
    page 2 menu 2
    page 2a menu 2
    page 3 menu 3
    page 3a menu 3
    page 3b menu 3
    page 3c menu 3

    Does this make sense? You will have to build each of the menus. So in your library you will have more then one menu, but each menu will be for each section of your website. So if you change the link in a section or add a new link to a section it will only update that section.

    Also I don't think having a css file linked to the menu is what your want to do (for population purposes, I could be wrong but the css file just tells it how to display, not so much what to display. If you are looking to go dynamic or something similar you might want to start looking into a php, cfm, asp, ruby etc. Css isn't really used for content, it is used to display your content.

    You could do your top nav and header in flash, and have rotating pictures etc especially if you know AS and javascript. That should be a piece of cake for you. If you are really good in AS you could link it to an external source to populate your drop down menu and to pull images for the header.

    I don't know what version of dreamweaver you are using but if you are using CS3, they have a drop down feature that works on the SPRY framework and is pretty easy to use. You might want to look into that also.
  3. ChicoWeb macrumors 65816


    Aug 16, 2004
    No need to overcomplicate it.

    That would be called an include, external style sheet, and a unordered list.

    You can essentially power the site from one navigation include.

    http://www.alistapart.com/articles/dropdowns/ -- This is a great tutorial for CSS and drop downs and I'm sure you can google include to figure the rest out.
  4. rhett7660 macrumors G4


    Jan 9, 2008
    Sunny, Southern California

    That is correct.. but from what it sounded like, he/she is going to have multipal pages that might have multipal content in multipal different drop down menus. If not, then what you said would be very easy to do. I could be wrong.

    I don't know if I had a site say of three hundred possible pages or more that one navigation menu is going to suffice. Of course there are many ways to skin a cat when it comes to navigation.

    CSS is not used to populate information, it is used to display a website. I would always link my css styles to a page that way I can change across multipal pages with a click.

    Here is another site aside from the one chico pointed out: http://www.htmldog.com/articles/suckerfish/dropdowns/
  5. RoboCop001 thread starter macrumors 65816

    Oct 4, 2005
    Toronto, Canada
    Thanks for the replies!

    Yeah, I'm not actually sure how many pages there will be, but it could be anything. It's a website for a magazine, so there's always new pages popping up when a new event happens, reviews, anything. So there's going to be a lot of pages. At least 19 to start, I think. And then god knows how many.... lol

    Basically the drop down menus are just for the nav bar, they will display the subsections for each section. On top of that, at least some (if not all) of the drop down menus will need to be dynamic, and load new sections as they are created. Especially new events taking place.

    A CMS is going to come into play here at some point, I'm sure.

    Anyway, I'll read over those links about drop down menus! Thanks again, and if you know of anything else that comes to mind, don't hesitate to let me know =)

  6. InLikeALion macrumors 6502a

    Jul 18, 2007
    Greener places than I used to live
    Uh, it seems like you need to plan out more thoroughly how you are going to develop this site. Being a regularly updated e-zine, you most certainly should use a CMS of some sort, and plan on it from the beginning. That's not some thing you can really shoe-horn in at the end.
  7. HaGG macrumors member

    Jun 2, 2007
    Once you have a basic version up, make sure you take a look in different browsers, especially IE 6, sometimes they don't work.
  8. RoboCop001 thread starter macrumors 65816

    Oct 4, 2005
    Toronto, Canada
    Yeah, I know.
    The page I'm working on right now doesn't need a CSM though. However, the client has a CMS built already, and apparently I just need to connect it.

    Their script person suddenly left, and now I'm having to learn all this stuff, on top of that, it's a very tight deadline.

    Insane, I know. But so far it's going ok.

    I'm making the menus manually for now. Then I'll go back and make them dynamic.

    Sure, it's not the best way. But right now it's the only way to meet the deadling.


    And damn you Internet Explorer. lol

Share This Page