INTRO

INTRO

New

Intro to the Designer

Intro to the Designer

New

2:48

Intro to HTML & CSS

Intro to HTML & CSS

New

3:38

HTML Structure

HTML Structure

New

1:55

WEB STRUCTURE

WEB STRUCTURE

New

The Box Model

The Box Model

New

1:54

Element Hierarchy

Element Hierarchy

New

3:57

Navigator Panel

Navigator Panel

New

2:45

ELEMENTS

ELEMENTS

New

Element Panel

Element Panel

New

1:49

Section

Section

New

4:14

Container

Container

New

2:44

Columns

Columns

New

2:22

Div block

Div block

New

3:37

Buttons & Links

Buttons & Links

New

Button

Button

New

14:08

Link Block

Link Block

New

9:35

Text Link

Text Link

New

1:16

Typography

Typography

New

3:20

Heading

Heading

New

2:02

Paragraph

Paragraph

New

4:42

Rich Text

Rich Text

New

3:52

Text Block

Text Block

New

0:56

Block Quote

Block Quote

New

0:42

List

List

New

2:31

Media

Media

New

Image

Image

New

3:39

Image File Types

Image File Types

New

2:22

Image Resolution

Image Resolution

New

3:28

Assets Panel

Assets Panel

New

3:08

Video

Video

New

1:20

Background Video

Background Video

New

3:15

Components

Components

New

Intro to Forms

Intro to Forms

New

4:55

Styling Forms

Styling Forms

New

2:55

Navbar

Navbar

New

9:38

Styling a Navbar

Styling a Navbar

New

4:34

Navbar Menu Button

Navbar Menu Button

New

4:51

Slider

Slider

New

4:56

Tabs

Tabs

New

4:38

Lightbox

Lightbox

New

3:44

Map

Map

New

2:58

Dropdown

Dropdown

New

4:38

Social Media Buttons

Social Media Buttons

New

2:49

Custom Code Embed

Custom Code Embed

New

1:24

Symbols

Symbols

New

3:47

Styling Basics

Styling Basics

New

Intro to Style Panel

Intro to Style Panel

New

3:15

HTML Tags

HTML Tags

New

3:59

Classes

Classes

New

2:46

Combo Classes

Combo Classes

New

4:05

Text Style Inheritance

Text Style Inheritance

New

3:18

Style Manager

Style Manager

New

1:56

States

States

New

2:47

Transitions

Transitions

New

2:40

Color Picker & Swatches

Color Picker & Swatches

New

3:51

Color Values

Color Values

New

3:22

Layout Basics

Layout Basics

New

Intro to Web Layout

Intro to Web Layout

New

2:27

Display Settings

Display Settings

New

2:54

Padding & Margin

Padding & Margin

New

2:48

Width & Height Units

Width & Height Units

New

3:59

Floats & Clears

Floats & Clears

New

1:52

Flexbox & Grid

Flexbox & Grid

New

Intro to Flexbox

Intro to Flexbox

New

2:27

Centering elements with Flexbox

Centering elements with Flexbox

New

1:20

Equal height layouts with Flexbox

Equal height layouts with Flexbox

New

1:47

Grid layouts overview

Grid layouts overview

New

4:18

Flexbox vs. Grid

Flexbox vs. Grid

New

4:00

Advanced Layout

Advanced Layout

New

Positioning Overview

Positioning Overview

New

1:48

Relative Positioning

Relative Positioning

New

1:43

Absolute Positioning

Absolute Positioning

New

1:43

Fixed Positioning

Fixed Positioning

New

1:27

Z-Index

Z-Index

New

1:49

Overflow

Overflow

New

1:49

Styling Typography

Styling Typography

New

Intro to Web Typography

Intro to Web Typography

New

3:20

Typography Units

Typography Units

New

2:43

Line Height

Line Height

New

1:38

Advanced Typography Styles

Advanced Typography Styles

New

3:01

Google Fonts

Google Fonts

New

1:18

Custom Fonts

Custom Fonts

New

1:27

Text Shadow

Text Shadow

New

2:36

Background & Border Styles

Background & Border Styles

New

Background Styles Overview

Background Styles Overview

New

2:20

Background Image

Background Image

New

2:04

Background Gradient

Background Gradient

New

3:02

Border

Border

New

3:07

Border Radius

Border Radius

New

3:22

Box Shadow

Box Shadow

New

3:34

3D Styles

3D Styles

New

Intro to 3D

Intro to 3D

New

2:25

3D Perspective

3D Perspective

New

4:01

2D & 3D Transforms

2D & 3D Transforms

New

4:53

EFFECTS

EFFECTS

New

Opacity

Opacity

New

1:44

Filters

Filters

New

2:59

Cursors

Cursors

New

1:45

Responsive Design

Responsive Design

New

new course
CSS grid landing page tutorial (36min)

Lesson info

Lesson info

The menu button is an element inside the navbar that organizes the nav links when there is limited horizontal space, like on a mobile device. It's sometimes referred to as the “hamburger menu.”

The menu button and its functionality are built into the navbar element, and can be accessed and configured in a number of ways. We’ll cover four aspects of the menu button:

  1. Triggering the menu
  2. Setting which breakpoints the menu displays on
  3. Animating the menu
  4. Styling the menu button

Explore this project

Want to dig into the project featured in this video and see how everything is put together? We've included the full project we used when making this lesson, and we've shared the link right under this very paragraph.

View and clone this projectDownload lesson assets
Clone this projectDownload project assets

Transcript

The menu button is an excellent alternative to horizontally cramming multiple menu links.

And it goes by many names. As a visual abstraction, the common menu button can remind us of a hamburger. Or gluten-free pancakes.

The menu button is built right into the default Navbar element. And it can be accessed and configured in a number of ways. We'll cover four aspects of the menu button: we're going to look at the Trigger itself (what's happening when we press the button), we'll look at Device visibility (how it shows up on different devices), then Menu types (some of the options we have there), and finally, styling our menu button.

As we already know, our nav links are enclosed in a nav menu, and we can see that in our Navigator. Now, that nav menu is actually the same element that shows up when we press the menu button.

And to demonstrate this, we can set a background color on this nav menu, like salmon. And two things happen. 1. Our design becomes hideous. And 2. We can see that the color we set cascades down to our Tablet view, and we can see that hideousness when we press the menu button. It's the same element. Inheriting that same color.

Now, a quick way to trigger that menu button from any view inside the Designer, is to click an element inside of our Navbar, go to Element Settings, and press Open Menu. Notice how the Designer automatically switched the view to Tablet. That's because if we go back to Desktop, our Nav Menu is already expanded. There is no menu button here; by default the Tablet view is the first to show a menu button.

So, let's go to Preview, and when we're in Tablet mode or below, our menu button appears. And pressing that button expands our nav menu. Pressing the menu button again, the nav menu collapses.

That's what happens when we press the menu button.

Let's talk about visibility on different devices.

As we already know, the menu button is visible starting on Tablet screenwidths, but you can modify this. Again, we can select anything inside our nav bar, and under Element Settings, we have device options right here at the bottom. If we want to show the full menu bar on Tablet, and we only want to display the button on phones, for instance, we can adjust that visibility by shifting down.

If we move over to Tablet view, the menu button doesn't show. Now we have all our nav links visible in our nav menu. Go down one more view, we have our menu button. Let's go back to the default view.

What if we always want the menu bar? Then we just shift up. Menu bar visible on the default view, as well. For now, let's put it back to Tablet.

That's device visibility.

Next we have menu types.

And to access these types, simply select any element inside our nav bar, visit our Element Settings Panel, and have a look right inside our Navbar Settings. We have three options here in our drop-down: coincidentally, the first — and default option— is "Drop Down." We also have Over Right. Let's take a look at that in Preview. We'll go to the Tablet view so our menu button is visible, and when we press? The menu comes in over the right side of our viewport. Press anywhere outside of it? And it collapses.

Let's go back.

Now this next one...is completely different. And we can access it the same way under our Element Settings Panel. This is Over Left. And when we preview it now? When we go to access our menu button, the menu...now comes in from the left.

Let's click out. And go back again. And for all these menu types. You can of course control the type of easing curve that's used to animate the open and close transitions, and you can change the duration. Let's say 47,000 milliseconds...which is of course 47 seconds. We'll preview again? And trigger the menu button. Let's watch.

This is a good time for a little macOS trivia...if you're running macOS. Hold down shift, and minimize any window. Watching the result is scientifically proven to reduce stress. And for our menu here, we'll watch this open animation all the way through. Our editor's gonna let the whole thing play out for--

And that's menu types. Finally, let's cover styling.

Now you can style any aspect of the navbar, or the nav menu. We're going to focus on the menu button here.

When we're in tablet view, for instance, and we select our menu button, we can see that there's no color set for the background. If you want to change that background color, of course, here's the place to do that.

And for the little hamburger icon, we can style that, too. And the best way to do that is to change the typography settings on its parent element. That's the menu button itself!

Want to change the size of the menu icon? We can adjust our font size. Want to change the color? We can style that from the Menu Button here as well. Because the menu icon is inheriting these typography styles from its parent — the menu button — these changes are affecting the menu icon.

And we can go back over and open our menu again and we can make the same kinds of style changes here. For instance, if we want to change the menu icon color on the Open state — once the menu is opened — we can do that here, too.

So. When we press the menu button, it triggers the display of the nav menu. We can adjust the visibility of the menu button based on the device being used. We can have our nav menu drop down, or come in from the right, or we can even have it come in from the left. And we can adjust styles on our menu button, including typography styles, which will pass down to the menu icon.

That's the menu button.