简体   繁体   English

背景透明不起作用

[英]Background transparent not working

Can you please take a look at this demo and let me know why the CSS rules of background-color: transparent;你能看看这个演示,让我知道为什么background-color: transparent; are not functioning on bootstrap panel body?在引导面板主体上不起作用?

#collapseOne .panel-body { background-color: transparent; }
.panel-body { background-color: transparent; }

Because you are not applying the CSS in right place.因为您没有在正确的位置应用 CSS。 You should apply your background transparent in <div> having class pannel Default .您应该在具有类pannel Default <div>中应用您的背景透明。

Here is the running Example:这是正在运行的示例:

Here is the Example:这是示例:

<div class="panel panel-default" style='background:transparent'>
<div class="panel-heading" role="tab" id="headingOne">
  <h4 class="panel-title">
    <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
      Collapsible Group Item #1
    </a>
  </h4>
</div>

I have written Inline CSS just for example to show.But don't go with it.我写了内联 CSS 只是为了展示。但不要使用它。 To make permanent effect navigate to your bootstrap CSS file and change this line要使永久效果导航到您的引导 CSS 文件并更改此行

.panel{
    background-color:#fff;
  }

to this one对这个

 .panel{
    background-color:transparent;
  }

It will make all your panel's background transparent.它将使所有面板的背景透明。

Also, never, ever forget to use.important.此外,永远不要忘记使用.important。

background-color:transparent !important;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM