html - Is it possible to apply CSS to an element whose name contains a particular string? -
i know can apply css styles element based on name:
input[name=description] { width: 200px; }
but possible apply css styles elements contain particular string in name?
imagine several inputs:
<input type="text" name="projectdescription"/> <input type="text" name="themedescription"/> <input type="text" name="methodologydescription"/> <input type="text" name="somethingelse"/> etc...
so, want apply styles inputs name contains word "description". can done without scripting?
yes, can:
input[name*="description"] { width: 200px; }
[attr] represents element attribute name of attr. [attr=value] represents element attribute name of attr , value "value". [attr~=value] represents element attribute name of attr value whitespace-separated list of words, 1 of "value". [attr|=value] represents element attribute name of attr. value can “value” or can begin “value” followed “-” (u+002d). can used language subcode matches. [attr^=value] represents element attribute name of attr , value prefixed "value". [attr$=value] represents element attribute name of attr , value suffixed "value". [attr*=value] represents element attribute name of attr , value contains @ least 1 occurrence of string "value" substring.
Comments
Post a Comment