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

I would like all my custom webpart and default webparts to look the same.

I know css classes like: ms-vh and ms-vb are used for the fonts, anchors and cell backgrounds. What would be the best way to override this to have my webparts have one look. I know I can use !Important but someone here had mentioned is the bad way And also would like to have one font for everything.

share|improve this question

When you add a css to your sharepoint site master page, you need to add it using a SharePoint:CssRegistration. For Eg:

 <SharePoint:CssRegistration name=”<% $SPUrl:~sitecollection/Style Library/Custom Style/css/custom.css %>" After=”corev4.css” runat=”server”/>

Here the 'After' attribute specifies that your custom.css will be rendered after the default 'Corev4.css' file of SharePoint. In this case, you need not use '!important'. All your styles are overridden automatically since your css is rendered last.

share|improve this answer

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.