SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible in SharePoint Designer 2013 to find the web part templates and wrap identifier div:s around them so I know what they are?

For example if I have a library web part and want to make them all blue, there seems to be no class that groups them in this way, however if I could wrap a div around the library template then I could achieve this.

share|improve this question

What you could do, is to use for example jQuery. There are elements lower down in the structure that has unique (well unique for all List View Webparts) classes.



That code adds the class tada-listview-webpart to the most outer element of a List View Webpart.

By running this code after the rendering of the List View Webpart, you have successfully added a class and thereby can add styling to the webpart by the class name :)

Example of running after load of sp.js:

}, 'sp.js');

Not one hundred percent sure that sp.js is the script you need to run after, but you can see the load order in the developer tools of a browser, and try the scripts one by one until it works.

share|improve this answer
Thanks, where would I put it? – LeBlaireau Aug 5 '13 at 14:00
For example in a Content Editor Webpart, or if you have a custom masterpage, you can add a <script> there. Note that you will need to add jQuery for using my code. Btw, a thanks is usually connected to an upvote ;) – Robert Lindgren Aug 5 '13 at 14:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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