To position the .search-container inline and to the right of the title and image in your header, you can use CSS Flexbox. You'll need to apply some adjustments to the header and its child elements. Here’s how you can modify your code to achieve this:
Set the header to be a flex container and align its children (title and search container) on a single line.
Adjust the flex properties to ensure the search container is aligned to the right side.
This update uses the display: flex; property on the header to lay out children in a row and justify-content: space-between; to place the search container inline to the right of the title and its image. The padding adjustments will make sure everything is visually well-aligned and spaced.
To make the search bar longer and ensure the header is adaptable to small screens, you can introduce some responsive design techniques, primarily using media queries. Here’s how you can update your CSS to make the header and its components responsive and to increase the size of the search bar:
Increase Search Bar Width: The #header-search-bar starts wider by default.
Responsive Flexbox: The header's flex-wrap: wrap; allows children to wrap when necessary.
Responsive Media Queries: For smaller screens (up to 600px), child elements of the header are set to take full width with width: 100%, ensuring they are centrally aligned. The search bar within this media query adjusts its width to 80% of the container for a more mobile-friendly size.
Flexible Spacing: Padding and alignment adjustments help transition smoothly between different screen sizes.
With these changes, your header should display appropriately across various screen sizes.