The following HTML
-markupHTML markup
<div id="child">
<input type="text"/>
</div>
and
css
CSS stylesheet
input[type="text"]:focus{
border: 1px solid green;
}
#child {
border: 10px solid grey;
border: 20px black solid;
background: aqua;
height: 50px;
margin: 10px;
}
are given. But I want tothe effect like of applying both hover
and focus
pseudo-elementclasses. I think that copy-paste of code like this:
input[type="text"]:focus{
border: 1px solid green;
}
input[type="text"]:hover{
border: 1px solid green;
}
isntisn’t a best way, because it's very upsize code. Is there exista way to do it without JS
applying JS?