The navy div with the rewards information is floating to the right. I want it to be better aligned with the white div with the search bar.
Any ideas why?
* {
margin: 0;
padding: 0;
}
.header {
background-color: red;
color: white;
display: flex;
justify-content: center;
padding: 20px;
}
.headerContainer {
padding: 20px;
width: 100%;
max-width: 1024px;
/* margin: 10px 0px 100px 0px; */
margin: 10px auto 100px;
}
.headerList {
display: flex;
gap: 50px;
}
.headerListItem {
display: flex;
align-items: center;
gap: 15px;
}
.headerListItem.active {
border: 1px solid white;
padding: 15px;
border-radius: 15px;
}
.headerTitle {
margin: 20px 0px;
}
.headerBtn {
background-color: maroon;
color: white;
border: none;
font-weight: 500;
padding: 10px;
cursor: pointer;
margin-bottom: 20px;
}
.headerBtn:hover {
background-color: maroon;
}
.headerSearch {
margin-top: 10px;
font-size: 20px;
padding: 15px;
max-width: 800px;
max-width: 100%;
height: 50px;
background-color: white;
color: red;
border: 3px solid black;
border-radius: 15px;
text-align: center;
margin-top: 10px;
margin: 0 auto;
}
.headerIcon {
color: red;
}
.headerSearchInput{
border-radius: 15px;
}
.headerSearchInput,
.headerSearchText {
flex-grow: 1;
margin-bottom: 15px;
margin-left: 10px;
font-size: 20px;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}
.headerSearchInner {
display: flex;
align-items: center;
justify-content: space-between;
}
.promoText,
.headerSearch {
width: 100%;
max-width: 800px; /* Adjust the max-width as needed */
/* margin: 0 auto; */
}
.promoText {
background-color: navy;
margin-top: 50px;
padding: 20px;
color: yellow;
border-radius: 15px;
align-items: center;
}
.promoTextInner {
display: flex;
justify-content: space-between;
}
.promoButton {
background-color: yellow;
color: navy;
border: none;
font-weight: 500;
padding: 10px;
cursor: pointer;
}
.promoButton:hover {
background-color: yellowgreen;
}
type or
const Header = () => {
return (
<div className="header">
<div className="headerContainer">
<div className="headerList">
<div className="headerListItem active">
<FontAwesomeIcon icon={faHotel} />
<span>Hotels</span>
</div>
<div className="headerListItem">
<FontAwesomeIcon icon={faPlane} />
<span>Flights</span>
</div>
<div className="headerListItem">
<FontAwesomeIcon icon={faCar} />
<span>Transport</span>
</div>
<div className="headerListItem">
<FontAwesomeIcon icon={faCampground} />
<span>Experiences</span>
</div>
</div>
<h1 className="headerTitle">Book your dream vacation!</h1>
<button className="headerBtn">Sign In/Register</button>
<div className="headerSearch">
<div className="headerSearchInner">
<div className="headerSearchItem">
<FontAwesomeIcon icon={faLocationDot} className="headerIcon"/>
<input type="text" placeholder="Where are you going?" className="headerSearchInput"/>
</div>
<div className="headerSearchItem">
<FontAwesomeIcon icon={faCalendarDays} className="headerIcon"/>
<span className="headerSearchText">dat to date</span>
</div>
<div className="headerSearchItem">
<FontAwesomeIcon icon={faBed} className="headerIcon"/>
<span className="headerSearchText">2 adults 0 children 1 room</span>
</div>
</div>
<div className="promoText">
<div className="promoTextInner">
<div className="promoTextInnerContent">
<FontAwesomeIcon icon={faHotel} />
</div>
<div className="promoTextInnerContent">
Join our rewards program for more deals.
</div>
<div className="promoTextInnerContent">
<button className="promoButton">Sign Up for Rewards</button>
</div>
</div>
</div>
</div>
</div>
</div>
);
}
export default Header; code here