How to make a button inside an input

I'm trying to make this input with a search button inside, but I'm not succeeding. How do I do this style?
No description
26 Replies
Zoë
Zoë2y ago
div
input(type="text")
button
div
input(type="text")
button
Then just remove styling on the input and make the container div look like the input. Do make sure that the input takes up all of the space left of the button, so even if clicking in the corner you select the input. For bonus points you can include a label under the button so clicking anywhere on the div not on the button selects the input
Chaves
ChavesOP2y ago
I'll try This is my html
Chaves
ChavesOP2y ago
No description
Chaves
ChavesOP2y ago
No description
Chaves
ChavesOP2y ago
Do I have to add a background-color to the container?
Zoë
Zoë2y ago
Yes, and also remove the background and border from the input
Chaves
ChavesOP2y ago
Holy shit I'm bugging
Zoë
Zoë2y ago
Bugging?
Chaves
ChavesOP2y ago
Isn't working I'll show you
Chaves
ChavesOP2y ago
No description
Chaves
ChavesOP2y ago
This is my HTML
Chaves
ChavesOP2y ago
No description
Chaves
ChavesOP2y ago
I don't know what's happening, but when I use background-color, it doesn't paint the entire div
Zoë
Zoë2y ago
Hmm
Chaves
ChavesOP2y ago
and not even the width changes, I put width: 100%; So the width should be 100% of the size of the parent, which in this case is the wrapper, correct?
Zoë
Zoë2y ago
I'll quickly make this so you can see what I'm going for. 1 sec
Chaves
ChavesOP2y ago
ok
Chaves
ChavesOP2y ago
Bro It worked but you will laugh Look what the problem was:
Chaves
ChavesOP2y ago
No description
Chaves
ChavesOP2y ago
No description
Zoë
Zoë2y ago
🤭 a classic I not only didn't notice that but it took me a couple seconds after you showed me to figure out what the issue was
Chaves
ChavesOP2y ago
haha Thanks thumbup
Chaves
ChavesOP2y ago
@z- ::theProblemSolver::
No description
snxxwyy
snxxwyy2y ago
I don’t believe you can use none on the background color property, only on the background shorthand, you’d have to use transparent
Zoë
Zoë2y ago
Good catch, didn't clock that

Did you find this page helpful?