My attempt to create this HTML file in Chrome posed some challenges:
<style>
br {
}
[required] {
border-width: 3px;
border-color: red;
}
</style>
<input required />
The entire content of the file is shown above. However, I noticed that the [required]
rule does not match and the <input>
remains unstyled.
If I remove the empty br rule so the file looks like this:
<style>
[required] {
border-width: 3px;
border-color: red;
}
</style>
<input required />
It works perfectly fine!
Why would having the <br>
rule before the [required]
one cause the [required]
to not match?
Thank you. (It works fine on jsfiddle, but the issue only arises when creating actual files.)