.container { width: 100%; position: relative; display: inline-block; } .button { margin-left: auto; margin-right: auto; font-size: 20px; width: 48px; height: 48px; display: flex; justify-content: center; align-items: center; border-radius: 50%; text-align: center; padding: 4px; background-color: #555; color: #fff; font-weight: 600; cursor: pointer; transition: background-color 300ms; } .container:hover .button { background-color: #333; } .list { display: none; opacity: 0; position: absolute; background-color: #333; width: calc(100% - 8px); z-index: 1; border-radius: 12px; overflow: hidden; border: 4px solid #333; transition: opacity 500ms; } .container:hover .list { display: block; opacity: 1; } .item { padding: 6px 4px; text-align: center; display: block; cursor: pointer; transition: background-color 300ms; } .item:hover { background-color: #555; }