-1

this is the html code here is not css and it has space between the button and input search

<div class="search-engine-container">
   <i class="search icon"></i>
   <input type="text" id="search_input" placeholder="...البحث عن المنتجات">
   <button id="clear-search-engine">x</button>
</div>

this how it looks like

enter image description here

Maik Lowrey
  • 10,972
  • 4
  • 14
  • 43

5 Answers5

4

an idea can be to use position of button inside container

if container position is relative you can set button to position absolute

.search-engine-container {
  position: relative;
}

.search-engine-container button {
  position:absolute;
}
<div class="search-engine-container">
        <i class="search icon"></i>
        <input type="text" id="search_input" placeholder="...البحث عن المنتجات">
        <button id="clear-search-engine">x</button>
</div>
jeremy-denis
  • 4,594
  • 3
  • 17
  • 26
1

You can add display: flex; to your .search-engine-container class.

.search-engine-container {
  display:flex;  
}
<div class="elm"></div>
<div class="search-engine-container">
    <i class="search icon"></i>
    <input type="text" id="search_input" placeholder="...البحث عن المنتجات">
    <button id="clear-search-engine">x</button>
</div>
Maik Lowrey
  • 10,972
  • 4
  • 14
  • 43
0

A way is seting margin:

button{
  margin: -5px;
}
<div class="search-engine-container">
        <i class="search icon"></i>
        <input type="text" id="search_input" placeholder="...البحث عن المنتجات">
        <button id="clear-search-engine">x</button>
</div>
Arman Ebrahimi
  • 1,727
  • 1
  • 3
  • 13
-1

the probem was in the white space We can remove white space by setting parent element font-size to 0 and child elements font-size to 17px

-1

The space is probably because of the margin around the input or around the button to remove it use the code below:

#search_input {
    margin: 0;
}
#clear-search-engine {
    margin: 0;
}

If this didn't work then the problem isn't because of margin but you still can fix it using margin:

#search_input {
        margin-right: -5px;
}

And you can adjust the number of pixels as you want.