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 have a link which opens my visual webpart inside Modal Dialog. I need to change the background color of Modal Dialog content area..dont want to make change in my custom css which is overiding corev4.css ..just want to make a change for a specific modal dialog.

share|improve this question

Apply this css..

.ms-dialog body #s4-workspace {


share|improve this answer

You could write out the CSS as part of your web part if that's the only place that web part is shown. Unfortunately, you can't reliably target CSS for a child frame, so you can't include that background color as part of the link (and have it work across all browsers).

You could also add a user control to the masterpage that checks for a query string. If that query string is set, override the background color. That's likely a bit overkill for what you want (if it's a one off scenario), but that would allow you to assign the background color through the URL to the dialog source.

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.