I am styling a page where I have only been given access to the CSS files.
I am looking to alter the style of an input element if it's value is not blank.
Here's what I have so far...
<input id="myInput" type="text" name="myInput" autocomplete="off" placeholder="Enter your Card Number">
and
input {
font-style:italic;
}
input:not([value='']) {
font-style:normal;
}
This doesn't work though as the text is never italicised.
Is it even possible to achieve this taking into consideration I can only edit the CSS file.?
:focus. But of course that won't be styled as soon as the input is blurred. You'll need to use JavaScript to achieve what you're trying to do.