• Stars
    star
    129
  • Rank 278,190 (Top 6 %)
  • Language
    HTML
  • License
    MIT License
  • Created over 9 years ago
  • Updated about 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A simple mega nav menu in pure CSS

Mega Nav in CSS

A simple mega nav menu in pure CSS.

Mega Wut?

Mega navs are an effective feature for large menu content and surprisingly easy to implement. If you've wanted to put one together but didn't know where to start, this quick walkthrough is for you.

How'd You Do It?

This implementation uses just CSS and nothing else. After creating a menu list, add <div class="mega-menu"> to the menu item where the mega nav should display. The following mega-menu class will hide the menu:

.mega-menu {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 0 0 3px 3px;
  opacity: 0;
  position: absolute;
  transition: all .3s ease .15s;
  visibility: hidden;
  width: 100%;
}

The mega nav is hidden until you hover over the menu item:

li:hover > .mega-menu {
  opacity: 1;
  overflow: visible;
  visibility: visible;
}

And voila...

Mega nav image 1

This implementation uses ARIA landmark roles following WCAG 2.0 compliance for accessibility. Keyboard-only navigation isn't include.

Support

Current versions of Chrome, Firefox, Safari, Opera, Edge, and IE8+.

License

The MIT License (MIT)

More Repositories

1

css-protips

⚡️ A collection of tips to help take your CSS skills pro 🦾
28,075
star
2

must-watch-javascript

🔥 JavaScript talks you have to see 📺 on functional programming, performance, frameworks, React, debugging, leveling up, and more! ⚡️
7,087
star
3

must-watch-css

🔥 CSS talks you have to see ⚡️ covering CSS Grid, flexbox, custom variables, performance, frameworks, Sass, tools, and more! 🚀
4,712
star
4

jquery-tips-everyone-should-know

A collection of tips to help up your jQuery game 🎮
4,260
star
5

responsive-css-grid

A super-lightweight, responsive, 8-column grid based on box-sizing
CSS
50
star
6

javascript-without-jquery

Tips and practical examples
50
star
7

fonts

Web fonts that you probably won't find in a CDN
40
star
8

super-simple-css-tooltips

Super simple tooltips
CSS
28
star
9

nodejs-chat

Chat app using Node.js and WebSockets
JavaScript
18
star
10

allthingssmitty.github.io

Where I write stuff 👨🏻‍💻
SCSS
16
star
11

functions-and-scope-in-javascript

Examples of functions and scope (closure) in JavaScript
16
star
12

accessible-mega-menu

A keyboard- and screen reader-accessible mega menu
HTML
15
star
13

css-breakpoints-in-js

A simpler way to keep your project's CSS and JavaScript in sync
JavaScript
10
star
14

media-query-load

Conditional loading of CSS using media queries
HTML
9
star
15

anything-ipsum

A lorem ipsum-style generator
JavaScript
6
star
16

vertical-timeline

A responsive vertical timeline
CSS
6
star
17

thug-grids

Simple, flexible, Sass-based so you can responsive grid system like you give a fuck
CSS
4
star
18

tweet-style-guide

A personal style guide for composing tweets
3
star
19

ux-assessment

CSS
3
star
20

musicbrowser

A front-end training tool and skills assessment
CSS
2
star
21

fixed-header-animated

A fixed header that animates on page scroll
HTML
2
star