Cognito-forms – Styling Content Fields in Cognito Forms

cognito-forms

I have several Content fields in my Cognito form which is embedded in a web page on my site.

I want to use CSS styling to change the font colour on one of them to red but can't see a way to reference a specific content field

Best Answer

I'm a developer with Cognito Forms.

The Content field can only be targeted as a whole, so inside the Content field you will have to set the text that you want to adjust to a heading in order to give it a tag that you can target.

So if you are not using the 'Heading 6' for anything else in the Content field you can select this to give the highlighted text the tag.

enter image description here

You can then use the h6 tag in conjunction with the tag for the Content field to target just the line of text with the h6 tag. In this example you will use the following CSS to target the h6 tag in the Content field. You will also want to keep in mind that in addition to changing the font color, you will also want to adjust the font weight and size, as this will also be changed by the default h6 styles.

.cognito .c-forms-form .c-html h6 {}