Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Twitter bootstrap 引导:如何从模式中移除框阴影?_Twitter Bootstrap_Css - Fatal编程技术网

Twitter bootstrap 引导:如何从模式中移除框阴影?

Twitter bootstrap 引导:如何从模式中移除框阴影?,twitter-bootstrap,css,Twitter Bootstrap,Css,如何从引导的模式中删除框阴影?我尝试了下面的css,但是没有成功。有什么想法吗 css 引导 <!-- Button trigger modal --> <button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal"> Launch demo modal </button> <!-- Modal --> <div class="modal

如何从引导的模式中删除框阴影?我尝试了下面的css,但是没有成功。有什么想法吗

css

引导

<!-- Button trigger modal -->
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
  Launch demo modal
</button>

<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="false">
  <div class="modal-dialog custom-class">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="myModalLabel">Modal title</h4>
      </div>
      <div class="modal-body">
        ...
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">Save changes</button>
      </div>
    </div>
  </div>
</div>

启动演示模式
&时代;
情态标题
...
接近
保存更改

我确实尝试过这个,而且似乎有效

.modal-content{
    -webkit-box-shadow: 0 5px 15px rgba(0,0,0,0);
    -moz-box-shadow: 0 5px 15px rgba(0,0,0,0);
    -o-box-shadow: 0 5px 15px rgba(0,0,0,0);
    box-shadow: 0 5px 15px rgba(0,0,0,0);
}

无需担心,有一个非常简单的解决方案

您只需在CSS选择器中更加具体,并包括
div
。原因是您试图在引导CSS中覆盖的样式是编写的
div.modal-dialog{…}

在CSS中,
元素.class
.class
更具体,更具体的标记将始终优先

因此,您的解决方案很简单:

div.modal-content{
    -webkit-box-shadow: none;
    -moz-box-shadow: none;
    -o-box-shadow: none;
    box-shadow: none;
}

您的语法是正确的,可能css规则不够强大-您是否尝试添加!重要吗?是的,我知道。但是一点运气都没有。什么是
-0-box-shadow:
?哦,对于opera来说应该是
-o-
。有没有办法从所有引导元素中删除box-shadow?并添加边框:0px;当您只使用.modal内容并希望它完全融入背景/背景(使用相同的颜色)时。这非常适合创建全屏导航。
div.modal-content{
    -webkit-box-shadow: none;
    -moz-box-shadow: none;
    -o-box-shadow: none;
    box-shadow: none;
}