I have two list web parts on a page. When I add some css code to the script editor webpart, it makes changes to both lists, but I want to make changes only one list. What do I need to do in order for it to style only my desired list and not both?

  • Would you share your code please Commented Jun 18, 2015 at 10:55
  • i am using code from this link---codeproject.com/Tips/493775/…
    – KumarV
    Commented Jun 18, 2015 at 11:04
  • yeah there they are applying styles to a content editor webpart, and what you want to do? do you want to apply style for whole webpart or for a list? Commented Jun 18, 2015 at 11:12
  • I have shown 2 webparts in the page and i want to apply css to only one list.
    – KumarV
    Commented Jun 18, 2015 at 11:40

2 Answers 2


The probleme here is that you are modifying built-in css types. That's why those changes are applied to your second webpart too. You could use jQuery to apply new classes to the webpart you want to change and use the styles you defined.

How to get/change Webparts by javascript: https://msdn.microsoft.com/en-us/library/office/hh185010(v=office.14).aspx

Other interesting way would be to use jslink http://www.sharepointnutsandbolts.com/2013/01/using-jslink-to-change-ui-of-sharepoint_20.html

  • Actually I am new to these things, can u tell me in a little more detail?
    – KumarV
    Commented Jun 18, 2015 at 12:08
  • You are new to css and javascript?
    – Gwny
    Commented Jun 18, 2015 at 14:20
  • pls just show me a demo of code that i hv to put into into the content editor or the script editor web part.It should not change the look of all the list web part in the page but only the specific one.
    – KumarV
    Commented Jun 19, 2015 at 4:52

I got an easy way of doing this. For doing this we have to first get the id of the list from the source i.e by clicking going to the view page source and then we have to use the same ID in the script editor.This is how we can restrict script editor to make changes to only one list in the page and not affecting others.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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