Revamp snippet descriptions
This commit is contained in:
@ -5,10 +5,10 @@ tags: layout,animation,intermediate
|
||||
|
||||
Displays a menu overlay when the image is hovered.
|
||||
|
||||
- Use a `figure` to wrap the `img` element and a `div` element that will contain the menu links.
|
||||
- Use the `opacity` and `right` attributes to animate the image on hover, to create a sliding effect.
|
||||
- Set the `left` attribute of the `div` to the negative of the element's `width` and reset it to `0` when hovering over the parent element to slide in the menu.
|
||||
- Use `display: flex`, `flex-direction: column` and `justify-content: center` on the `div` to vertically center the menu items.
|
||||
- Use a `<figure>` to wrap the `<img>` element and a `<div>` element that will contain the menu links.
|
||||
- Use the `opacity` and `right` attributes to animate the image on hover, creating a sliding effect.
|
||||
- Set the `left` attribute of the `<div>` to the negative of the element's `width` and reset it to `0` when hovering over the parent element to slide in the menu.
|
||||
- Use `display: flex`, `flex-direction: column` and `justify-content: center` on the `<div>` to vertically center the menu items.
|
||||
|
||||
```html
|
||||
<figure class="hover-menu">
|
||||
|
||||
Reference in New Issue
Block a user