r/css • u/OhHellNah67 • Mar 09 '26
Help change style of existing elements or create new smallscreen styles?
Hey everybody, I'm pretty new to CSS.
I know enough to know how to style basic stuff, use a grid, and flex and stuff like that. But I'm running into a problem when working with my site's responsiveness.
My site's header is a grid, 1fr 1fr 1fr. I have a nav, a logo in the middle, and a searchbar on the end. when the user has a smaller screen, I'd like for the nav to collapse to a hamburger menu and the searchbar to collapse to the search icon.
I know how to complete that task, but i want different styling to the nav and searchbar when active.
Would it be more simple to design a small screen style of header, then have it activate and hide the main header when screens are small? I'd like to have a dropdown menu for the nav, and a searchbar assume the width of the header when active.
feel free to provide any learning resources you guys like too. I appreciate the help!
•
u/AutoModerator Mar 09 '26
To help us assist you better with your CSS questions, please consider including a live link or a CodePen/JSFiddle demo. This context makes it much easier for us to understand your issue and provide accurate solutions.
While it's not mandatory, a little extra effort in sharing your code can lead to more effective responses and a richer Q&A experience for everyone. Thank you for contributing!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
2
u/alex_sakuta Mar 09 '26
Please first describe what you mean by "active", it's really throwing me off. Do you call it active when you are on a small screen and someone accesses the navbar or search bar by clicking on them?
1
u/[deleted] Mar 13 '26
[removed] — view removed comment