Cognito-forms – Custom CSS to Individual Fields

cognito-forms

Is it possible to apply custom CSS to an individual field?

Best Answer

I'm a developer with Cognito Forms.

You can use CSS to target field types and labels when your Cognito Form is embedded on your website. You can use our list of CSS class properties, and then use CSS attribute selector to target a specific field.

This would use '[Data-Field="FieldName"] after the class property. If you wanted to target an Email Address field that was labeled 'Email' The CSS selector would look like the following.

.c-email[Data-Field="Email"]

With the full CSS looking like the following.

.c-email[Data-Field="Email"] {font-size: larger;}