I am using Telerik to generate a textbox. Now I would like to equip this with an animation.
The problem is that Telerik wraps a span around the input, so I don't know how to change the hr element when the input is focused.
My Code:
span.inputanimation {
width: 100%;
}
// Here is what i dont know how to do !
span.inputanimation > .input > input:focus hr.underline {
width: 100%;
}
hr.underline {
width: 0%;
transition: width 0.5s ease-in-out;
background-color: #17e13f;
height: 2px;
border: none;
margin-top: 2px;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link href="styles.css" rel="stylesheet" type="text/css"></style>
</head>
<body>
<!-- Generated with TelerikTextBox -->
<span class="inputanimation">
<span class="input">
<input id="Vorname">
</span>
<hr class="underline">
</span>
</body>
</html>
I removed some of the CSS classes and HTML Properties so it is better to look at.
My Telerik Code:
<span class="inputanimation">
<TelerikTextBox @bind-Value="Value"
Id="@Id"
PlaceHolder="@Label"
Class="input">
</TelerikTextBox>
<hr class="underline" >
</span>