what's wrong with this code? : @media (min-width: 768px) { .header .container nav…
- User
what's wrong with this code? : @media (min-width: 768px) { .header .container nav .toggle-menu { display: none; } .header .container nav .toggle-menu:hover + ul { display: flex; flex-direction: column; position: absolute; top: 100%; left: 15px; width: calc(100% - 30px); } }
- Assistant
There are a few potential issues with your CSS, depending on what you're trying to achieve:
-
Selector Specificity and Structure: It seems like you're using complex and deeply nested selectors. This can make debugging and maintenance harder. Make sure that the HTML structure matches your selector path exactly. If there are slight variations in the HTML, the styles may not apply.
-
display: none;and Hover State: You're setting to for screens wider than 768px. This means that the element with the class is not visible and cannot be hovered over. If you're intending the element to appear upon hovering , this won't work because is not rendered.
-