I have absolutely positioned div(#searchContainer) which contains input and a button.Currently div is aligned to the right.I would like to create media rule which would horizontally center this div on screens less then 600px wide.Also i would like both input and a button to have width 100% of a parent element so that button is under the input(on screens less then 600px wide).
#searchContainer {
padding: 15px;
position: absolute;
top: 0;
right: 0;
}
#searchContainer input {
width: 200px;
}
#searchContainer button {
background-color: rgb(1, 159, 198);
width: 75px;
}
<div id="searchContainer">
<input
class="searchControl"
type="text"
placeholder="City Name or Zipcode"
id="searchInput"
/>
<button class="searchControl" id="searchBtn">Search</button>
</div>