A developer wants a sidebar to be fixed on the desktop but static on mobile devices. Which CSS properties and values will they need to adjust using media queries?
- position: absolute, right: 0;
- position: fixed, left: 0, top: 0;
- position: static;
- position: sticky, top: 0;
When dealing with a sidebar that needs to be fixed on desktop and static on mobile, the appropriate approach is using position: sticky with a value of top: 0 within a media query. This ensures the sidebar remains fixed on desktop but becomes static on mobile.
Loading...
Related Quiz
- In a mobile-first design, what is the typical default layout style before any media query is applied?
- When defining a CSS variable within a specific element, how does its scope differ compared to when it's defined in :root?
- To run animations in reverse order after they complete, the value for animation-direction should be ________.
- How can the improper use of custom fonts negatively impact accessibility on a website?
- To ensure text resizing without loss of content or functionality, use the CSS unit ________ for font sizes.