0

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>

2
  • 1
    I am glad you got success in opening a Modal Dialog :) Commented Nov 27, 2012 at 12:36
  • Yes but after many many many of trying :) ;) ;)
    – Grzegorz Z
    Commented Nov 27, 2012 at 13:31

1 Answer 1

2

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

5
  • 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
    Commented Nov 27, 2012 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} Commented Nov 27, 2012 at 14:00
  • Yes but how put in Sharepoint Modal dialog a class
    – Grzegorz Z
    Commented Nov 27, 2012 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
    Commented Nov 27, 2012 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
    Commented Nov 27, 2012 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.