I have an URL input <input id="my_input" type = "email> and I want to change the pattern attribute. I don't want to do that inline but using the following CSS file
#my_input{
pattern:".*test.*"
}
I get a "unknown property: pattern"
The pattern attribute is a HTML attribute not a CSS property. Here is an example:
<input type="text" pattern="[a-z]{4,8}" title="4 to 8 lowercase letters">
HTML attributes must be provided inline and cannot be provided in external CSS files.
It is important to note that the HTML attribute if very limited, and it it more common to use JavaScript for input validation due to its broader functionality.
For more information read the MDN docs