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

Webflow's navbar element is very flexible when it comes to styling. In this video, we're going to focus on five areas that give us that control:

  1. Size of the navbar
  2. Positioning of the navbar
  3. Nav link states
  4. Navbar and nav link backgrounds
  5. Nav link transitions

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 Navbar element is very flexible when it comes to styling, and we're going to focus on five of the biggest areas that give us that control: size, positioning, typography, backgrounds, and transitions.

Let's start with size. Our Navbar's height is being determined by the content inside. That means if we select the Navbar itself, it has no preset values for width or height. We can constrict it horizontally by setting a width or by putting it inside a container, but when it sits inside our page Body, it's going to take up the full width.

Now in this example, we've already applied a class to each of these nav links. That means changes to that class affect all the nav links in the Navbar.

So, what's one way to adjust size? If we hold option, and click and drag to adjust our padding, we can see that the size of our Navbar adjusts accordingly. As we change our padding, the size of our nav links, and therefore all its parent elements, is changing with it. 

That's one way, but a more uniform approach might be to select the Navbar itself. If we adjust padding on that, again holding down option, we can control the height because we're creating extra space between the Navbar itself and the Container which has all our Navbar elements inside.

We can also make these changes in our Nav menu. If we look at the Tablet view, under our Element Settings Panel, we can open our menu and make changes inside. If we select our nav link over in our Element Style Panel, we can make similar adjustments. Holding option again to adjust the padding on the top and bottom at once. And we can see the size of the Nav Menu in this case is affected. This is really helpful for making sure that everything fits nicely, and that the size of your tap targets is large enough so finger taps on touch devices are intentional. And deliberate. And other synonyms.

That's size as it relates to the Navbar.

Next is positioning. By default, the position of the Navbar stays where you drop it. It takes up the full width because it’s display setting is set to Block by default. What if you want it to stay at the top of the page when you scroll? We can simply switch our positioning to fixed, using the top preset (to make sure our content takes up the full width of the viewport). And of course, the Navbar's position is persistent as we scroll.

And that's positioning as it relates to the Navbar.

Next we have typography. And a common styling change we can do here is on the nav links themselves. Now again, for this demo, we’ve gone in and added the same class to each of these, so we'll select one and make changes to that. And one of the simplest ways to visually indicate a hover is a color change on hover.

Under states, we can select hover, and choose a different font color here. We can go to white for now so we can observe the effect. And when we hover? Our font color now displays as white.

Next, let's talk about background.

With our Navbar selected, we have the same types of controls to modify background values. By default, we have an inoffensive gray background color.

We can set up a gradient on top of that. And we can set the colors for each of the stops in that gradient, and then once we've done that, we can tweak the positioning of each of the stops to achieve the look we want.

Of course we don't have to use a gradient; we can also simply set a background color right on our Navbar.

And of course, we can do the same thing with our nav links here on hover. Just like we did for text, we can go into the hover state, and set — for instance — a background color on hover. And when we do that, anything inside the boundary for our nav link will be affected on hover.

That's background.

Finally, let's talk transitions.

Right now, our text color and our background color immediately cut on hover. If we want to smooth that out so they fade or dissolve between those values, we can do that under transitions.

We'll go in and add two transitions: creating our first transition for font color. For now, we'll keep the default 200 millisecond value. And after that, we can add a second transition, this time affecting the change in our background color.

Once we're finished with that, we can hover over the nav links right on our canvas...and they transition smoothly.

And remember that one time? When we did that fixed Navbar? Sometimes you might want to add some transparency there. Simply choose a background color and drop the opacity a bit, and you'll get that precise effect.

So. By default, a Navbar's size is determined by the brand and the nav links inside. But you can set padding to make adjustments. The Navbar is a block element which pushes content down, but we can do fixed – if we want a fixed-position or persistent Navbar. We reviewed adjusting typography settings like nav link font color on hover. We adjusted the background on our Navbar; we changed the nav link backgrounds on hover. And of course we set transitions. We can smoothly transition from one state to another.

That’s...Navbar styling.