0
How do I make this search bar instead of being opened right be opened left?
<style>
input.input_home {
height: 50px;
border: none;
outline: none;
padding-left: 50px;
width: 0;
position: absolute;
top: 0;
left: 0;
background: none;
z-index: 3;
transition: width 1s ease-out;
cursor: pointer;
}
input:focus {
border: 1px solid #ccc;
border-radius: 25px;
width: 50%;
z-index: -1;
transition: width 1s ease-in;
}
button {
height: 50px;
width: 50px;
background: url('lupa.png') center no-repeat;
border: none;
position: absolute;
top: 0;
z-index: 2;
cursor: pointer;
}
button:focus {
outline: none;
}
/* esconde o LABEL "Buscar" */
label {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0,0,0,0);
border: 0;
}
</style>
<form action=" " method="post">
<label for="busca">Buscar</label>
<input class="input_home" type="search" id="busca" name="q">
<button type="submit">OK</button>
</form>
What I would like brother is just the opposite, that the button was on the right and when clicking on it the bar was on the left
– Cairoodev
@Cairoodev if she goes left will go off the screen...
– hugocsl
Then I just put the boot on the left side too? You can do this?
– Cairoodev
then the input and the btn will go out of the screen, I see no sense in it, I think I must have understood something wrong, because growing to the left does not seem right. You can show an example or explain in a little more detail?
– hugocsl
This I would like to know if it is possible to do with this po code. Just imagine this effect going from right to left
– Cairoodev
@Cairoodev if I understood it, I think I would, but in this case the ideal would be to have another element behind it that would have this gray border, and it would grow backwards. You would have to think of another way to build this HTML structure and CSS tb would change a lot.
– hugocsl