The :focus pseudo-class applies while an element has the focus. (Source: W3C)
<input type="text" name="example-field" id="example" />
input{color:black}
input:focus{color:red}
In the example, the text should turn red when you place your cursor inside the text field.