-2

I have a field in SharePoint list. I am trying to apply a background color in the display form. Name of field is Process Instruction.

I am having trouble with the .css syntax. It Works fine in IE Developer, but I can't translate into working .css in the CEWP.

How would I apply the style using .css?

DOMpicture

0

Add a new content editor webpart and use following

<style>
   #SPFieldNote {
      background-color:red;
   }
</style>

Update

<style>
   #SPFieldNote:nth-child(2) {
      background-color:red; /*Assuming the element in question appears 2nd in order*/
   }
</style>
  • #SPFieldNote is a field type and applies the background to 4 other fields in addition. How do I specify just the single field (Process Instruction) for the style? – Quasimodo Dec 22 '14 at 22:54
  • We need to somehow identify the correct element. You can probably use the nth:selector. See updated answer. – Amal Hashim Dec 22 '14 at 22:59
  • nth selector not doing the job...doesn't apply to any single field no matter the value used; still searching for way to apply style to an individual field. – Quasimodo Dec 23 '14 at 16:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.