Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.