Create Navigation Menus with jQuery and Dreamweaver
Illustration by John Hersey

Adding CSS rules to style the menu


From:

Create Navigation Menus with jQuery and Dreamweaver

with Chris Converse

Video: Adding CSS rules to style the menu

Now there is a fair amount of CSS that goes along with styling these dropdown menus. So I have gone ahead and created the snippet to kind of give us a jumpstart. So from Dreamweaver come up to the File menu, let's choose Open. Go into the exercise files, folder 3, and let's open up dropmenu.css. So in here I have added a bunch of comments to help you understand what part of the dropdown menu each one of these styles is affecting. So all items, top items are the ones that go across the very top, the sub items are the first level dropdown menus, and then the sub sub-items, which is the third-level menu items. And down here we also have the indicators.

Start your free trial now, and begin learning software, business and creative skills—anytime, anywhere—with video instruction from recognized industry experts.

Start Your Free Trial Now
please wait ...
Watch the Online Video Course Create Navigation Menus with jQuery and Dreamweaver
25m 49s Intermediate Aug 09, 2012

Viewers: in countries Watching now:

Find out how to add stylized dropdown menus to your web site using HTML, CSS, and JavaScript. Working in Dreamweaver, author Chris Converse breaks down the menu design process, explaining how to build a menu foundation using unordered lists, establish hierarchy with nested submenus, apply styling using CSS rules, and incorporate dropdown functionality using a jQuery plug-in.

To preview the finished project, visit: http://codifydesign.com/chris/lynda/samples/course-0015

This course was created and produced by Chris Converse. We are honored to host his material in the lynda.com online training library.

Subjects:
Developer Web
Software:
Dreamweaver jQuery
Author:
Chris Converse

Adding CSS rules to style the menu

Now there is a fair amount of CSS that goes along with styling these dropdown menus. So I have gone ahead and created the snippet to kind of give us a jumpstart. So from Dreamweaver come up to the File menu, let's choose Open. Go into the exercise files, folder 3, and let's open up dropmenu.css. So in here I have added a bunch of comments to help you understand what part of the dropdown menu each one of these styles is affecting. So all items, top items are the ones that go across the very top, the sub items are the first level dropdown menus, and then the sub sub-items, which is the third-level menu items. And down here we also have the indicators.

These are custom CSS rules that I have added into this particular plug-in, and we're going to look at activating with the jQuery, adding indicators to those menus. This plug-in doesn't actually have that built-in to the architecture. Now I'd also like to call your attention to the display: none attribute here that's inside of the main dropmenu. This is going to be applied to the UL, where we just applied a dropmenu class in the last movie. So what this is going to do is through CSS hide this entire menu. So what's going to happen is the entire menu is going to be hidden, and then when the jQuery plug-in initializes, it's going to turn the menu from being invisible to being visible.

This way your users don't see a huge unordered list before the JavaScript has a chance to manipulate the layout to turn it into menus. So now inside of the snippet, let's copy all of this code, let's copy it to the clipboard, and then close this file, back in our index.html file. If you're using Dreamweaver CS4 or later, you see all of these related fields here. I can simply come in here and click on menu.css and access that file. Earlier versions of Dreamweaver, you can go to the File menu and just open the menu.css in the myMenu folder we created on the desktop.

So inside of the menu.css let's come down to the bottom. I have the first rule in here already for nav menu. Let's hit Return, let's paste in all of the CSS rules, and choose File > Save. Now if we click on Live View, we'll see over here in the preview area the menu is actually hidden because of that display none on the topmost item, but all of the CSS rules are taking effect on those actual items, even though the main item has a display set to none. So now all of the markup in CSS is in place. In the next movie we can modify the JavaScript file to initialize the plug-in against our markup.

Find answers to the most frequently asked questions about Create Navigation Menus with jQuery and Dreamweaver .


Expand all | Collapse all
please wait ...
Q: Where can I find more menu information and plug-ins from menu systems?
A: There is a great article from 1stwebdesigner, "38 jQuery And CSS Drop Down Multi Level Menu Solutions", where they list and explain thirty-eight different plug-ins and techniques.
 
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ .

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

* Estimated file size

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Create Navigation Menus with jQuery and Dreamweaver.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member ?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferences from the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Learn more, save more. Upgrade today!

Get our Annual Premium Membership at our best savings yet.

Upgrade to our Annual Premium Membership today and get even more value from your lynda.com subscription:

“In a way, I feel like you are rooting for me. Like you are really invested in my experience, and want me to get as much out of these courses as possible this is the best place to start on your journey to learning new material.”— Nadine H.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.