I'd like to make the textarea
and input
fields of Bootstrap to have the Material Design look.
I'm currently using the stable version of Bootstrap — 3.3.7
What I'm planning to happen is:
- Make the label float when the field is focused.
- And a colored line expands from the middle of the bottom border to the left and right. (similar to this guy's question)
I tried a possible solution, although it's really working, I prefer not to use it for a reason.
- The solution is from this tutorial site and the similar implementation for Bootstrap from this CodePen demo.
The demo code is here (floating labels only).
The reason why?
- You need to add two
<span>
element, one for the 'bar' and one for the 'highlight', for the expanding colored line to work which I don't like. - There's a bug for
<input type=email>
that if you didn't enter the required characters, the floating label will return back as a placeholder and it's a mess for the field.
Okay, so is it possible with CSS background-image
/ transition / animation and or with the use of jQuery?
Here's my demo code of what I'm left of.
Thanks.