Creating a hover menu

Creating a hover menu

Hover menus are used to show things like menus and more information when you hover over an element. These are similar to pop ups seen in other examples.

How to create an hover menu

Use the CSS template to show a menu when hovering over an element.

Menus are typical but you can have show other content.

You can also review the pop up examples to see other ways to show pop ups.

If you are going to use it on more than one artboard consider making it a component

Group the menu button and the menu

Select the menu group and in the Element Options panel click on the CSS template field

Enter the following in the CSS template field

/* show all descendants and add pointer cursor on hover */
{SELECTOR}:hover * {
     display: block;
     cursor: pointer;
}

/* add background padding to create a highlight */
{SELECTOR} a {
   padding: 9px 16px;
}

/* change background color on hover */
{SELECTOR} a:hover {
   background-color: #ddd;
}

Export the page and test in the browser.

Example project:

Last updated