My Goal
To have a search bar (which is a post method form) and its submit button merged/fused as one. Like this:
- Platform: WordPress
- Builder: Elementor (Pro)
- Widget: Custom HTML
What I Have
I have tried (with my limited knowledge) and this is what I am sitting with:
.domSearchWrap {
position: relative;
display: inline;
}
.domSearchWrap .searchTerm {
border: 3px solid #0a7c82;
border-right: none;
border-radius: 20px 0px 0px 20px;
outline: none;
color: #0a7c82;
height: 60px;
}
.searchTerm:focus {
outline: none;
}
.domSearchWrap .searchButton {
width: 40px;
height: 60px;
border: 1px solid #0a7c82;
background: #0a7c82;
text-align: centre;
border-radius: 0px 20px 20px 0px;
}
<div class="domSearchWrap">
<div class="domSearch">
<form action="https://XX.XXXX.com/cart.php?a=add&domain=register" method="post">
<input type="text" class="searchTerm" placeholder="Type your desired domain name here..." name="query">
<button type="submit" class="searchButton">
<i class="fa fa-search"></i>
</button>
</form>
</div>
</div>
What am I doing wrong?
2
Answers
2 issues here:
.searchTerm
is heigher because of the border. To fix that, add:.searchTerm, searchButton { box-sizing: border-box }
.domSearch form { display: flex; }
You can solve this problem in more than one ways.
First : Put icon inside input element in a form
and more but my solve is here =>