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.


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.

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.