I have a problem with this HTML code I'm trying to write. This is the actual code:
<div class="container-fluid cover">
<div class="container search">
<h1 class="search-carport">Search your carport</h1>
<input type="text" placeholder="Search...">
</div>
</div>
In my container fluid I just have a picture, which is like a BG cover, but I want to put a <h1>
and <input>
on top of that picture to pretend it's a search bar in the middle of this picture.
This is my CSS for it: (I'm also putting there .cover so you can imagine there is that picture as a background)
.cover {
background-image: url("../img/cover.jpg");
background-repeat: no-repeat;
background-size: cover;
background-position: 50% 60%;
height: 525px;
}
.search {
position: relative;
text-align: center;
height: 525px;
}
So as you can see, the <h1>
and <input>
they are centered, but they are on the top. vertical-align: middle;
is not working, also align-item: center;
is not working.
Hopefully, I've mentioned everything that is needed. If not, I'm sorry. I'm pretty much new to this.