admin管理员组

文章数量:1401659

I want to change color of dimmer of my modal, but I can't! what should I do?

<div class="ui modal">
  <i class="close icon"></i>
  <div class="header">
    Profile Picture
  </div>
  <div class="content">
    <p>sth</p>
  </div>
  <div class="actions">
    <div class="ui black button">
      Nope
    </div>
    <div class="ui positive right labeled icon button">
      Yep, that's me
      <i class="checkmark icon"></i>
    </div>
  </div>
</div>

In JS:

I tried for example following code, yet, no change!

$('.ui.modal').each(function() {
    $(this).modal({allowMultiple: true}).modal('show').css('background-color', 'yellow');
});

I want to change color of dimmer of my modal, but I can't! what should I do?

<div class="ui modal">
  <i class="close icon"></i>
  <div class="header">
    Profile Picture
  </div>
  <div class="content">
    <p>sth</p>
  </div>
  <div class="actions">
    <div class="ui black button">
      Nope
    </div>
    <div class="ui positive right labeled icon button">
      Yep, that's me
      <i class="checkmark icon"></i>
    </div>
  </div>
</div>

In JS:

I tried for example following code, yet, no change!

$('.ui.modal').each(function() {
    $(this).modal({allowMultiple: true}).modal('show').css('background-color', 'yellow');
});
Share Improve this question asked Apr 30, 2015 at 7:15 Alireza GhaffariAlireza Ghaffari 1,1145 gold badges16 silver badges31 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 5

Use the background-color property on element .dimmer with an rgba type css color value to introduce transparency.

.dimmer { background-color: rgba(250,250,50,0.8) }

To apply this CSS using jQuery, use the jQuery#css method like so:

$(".dimmer").css("background-color","rgba(250,250,50,0.8)");

本文标签: javascriptSemanticUI How to change dimmer background colorStack Overflow