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

How can I change a name of class in Sharepoint Modal dialog. I want to color a background of massage so it be good to change a name of class="ms-dlgFrameContainer", but where could i Find this class to change it ? Here is a HTML from firebug. I want to add a 4 modal werb with 4 kind of background-color:

<div class="ms-dlgBorder" style="width: 400px; height: 107px;"> <input class="ms-hidden" type="button" value="Umieść fokus na końcu okna dialogowego"> <div class="ms-dlgTitle" style="width: 400px;"> <div class="ms-dlgFrameContainer" style="width: 400px; height: 75px;"> <div>Dzień w którym wpisujesz projekt jest dniem świątecznym, czyli ustawowo wolnym od pracy, informujemy Cię o tym.</div>

share|improve this question
1  
I am glad you got success in opening a Modal Dialog :) –  Arsalan Adam Khatri Nov 27 '12 at 12:36
    
Yes but after many many many of trying :) ;) ;) –  Grzegorz Z Nov 27 '12 at 13:31

1 Answer 1

up vote 2 down vote accepted

I believe the modals are generated via javascript, and the classes and objects which wrap it are controlled within the JS file. Your best bet is to add a CSS to your master page which overrides ms-dlgFrameContainer with your preferred styling.

HTH

share|improve this answer
    
But i must done it 4 times to have 4 Background-colors. I tryed done it with div, but i don't know how set up a lenght and hight of div. And I tryed to give a div {} Next Color div div {} Next color div div div{} and next color div div div div{} But the height of the column are diferent –  Grzegorz Z Nov 27 '12 at 13:27
    
CSS will allow you to do multiple DIVs, something like DIV DIV DIV {css}, however each div you provided has a class name, so you can override each one directly, DIV.className {css} –  David Lozzi Nov 27 '12 at 14:00
    
Yes but how put in Sharepoint Modal dialog a class –  Grzegorz Z Nov 27 '12 at 14:03
2  
You can override the out of the box CSS that the modal dialog uses using the method that @DavidLozzi provided, there should be no need to inject custom inline styles or classes into it. That said, you must follow good CSS practices, which means your new class you're overriding with has to follow the same or greater specificity than the classes used by SharePoint, or your styles won't override it. Use Firebug to look at the full CSS selector name for the div(s) you want to change, and use that same selector to define your new look. Load that CSS in your master, and it'll be used in the dialog. –  webdes03 Nov 27 '12 at 14:27
    
So I schould put a lot of dives with classes, and call from dives with classes from the last ones to nerest ones. Thanks –  Grzegorz Z Nov 27 '12 at 14:55

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.