Apply default class to all types of *n*

bills4

New Member
Is there a way to apply a \[code\]class\[/code\] by default to an element? Let's say for example I wanted to apply the class \[code\]foo\[/code\] to all \[code\]input\[/code\] elements:\[code\].foo { ... }\[/code\]My limited knowledge leads me to believe I need to mark that up every single time:\[code\]<input type='text' class='foo' /><input type='password' class='foo' />...\[/code\]But, clearly I was hoping I could apply that class by default to all \[code\]input\[/code\] elements in the CSS somehow. I look forward to your answers!UPDATEIn an attempt to clarify myself, I do not want to duplicate the CSS that already exists for \[code\]foo\[/code\] because I wouldn't want to have to change that in multiple places if I needed to change the style for \[code\]foo\[/code\]. Further, I will be applying it to more than just all \[code\]input\[/code\] elements.
 
Back
Top