Check out this CSS code snippet.
.form-field {min-height: 20px; margin-bottom: 10px; padding-top: 4px; width: 80px;}
.form-field TEXTAREA, INPUT[type='text'] {position: absolute; left: 100px; top: 0px; height: 15px;}
.form-field TEXTAREA {height: 80px;}
If there is an input
or textarea
within the div.form-field
, the specified css rules will be applied to them.
However, the issue arises when the css also gets applied to any INPUT[type='text']
elements, even if they are not inside a .form-field
. How can this behavior be prevented?