I have a html login form and I try achieve the same style google has now in their login forms (2019-2020). First photo is when not clicked, second photo is when clicked.
I've tried the following approach, but I don't like the result.
<form>
<fieldset style="padding:1px;">
<legend style="padding:0px;">E-mailaddress or phonenumber</legend>
<input style="width:90%;" type="text">
</fieldset>
</form>
On the official google login page, the placeholder "slides" to the border when clicked. If I can't achieve this without using Javascript, than this is not an option for me, as I'm making a CPD portal page. This does not allow JavaScript.
The text should not be visible on the border when the input field is not clicked, and it should be visible when the input field is clicked and when the user is typing.
I've also tried this:
body {
background-color: #ccc;
}
input {
border: 1px solid #000
width: 200px;
padding: 20px;
font-size: 20px;
}
#myInput::-webkit-input-placeholder {
border-style:solid;
border-width:medium;
}
#myInput:-moz-placeholder {
border-style:solid;
border-width:medium;
}
#myInput:-ms-input-placeholder {
border-style:solid;
border-width:medium;
}
<input id="myInput" type="text" placeholder="Add border to this text" />
This is not exactly what I'd like to achieve, and when I try to make this responsive with diffrent screen sizes the text in the border gets on the wrong places and it's difficult to place it correctly. If anyone could help achieve what I show in the images, that would be amazing. Thank you in advance.