I'm trying to achieve the same effect as Google login page has for it's field (i.e. upon clicking the field the placeholder changes location, size and color).
So far I've come up with this: https://jsfiddle.net/rb846sdn/
CSS:
#emailField {
width: 100%;
font-family: Roboto,RobotoDraft,Helvetica,Arial,sans-serif;
font-size: 14px;
border: none;
border-bottom: 1px solid lightgrey;
color: grey;
}
#emailField:focus {
position:absolute;
font-size: 11px;
width: 82%;
top: 2em;
}
The problem is that changing the position of the input placeholder to absolute and managing it's position that way moves the whole field which is not behavior I'm looking for.
And now the questions:
1) How to move and resize the placeholder text without moving the field location (and it's borders)?
2) Is it possible to do this without Javascript/jQuery?