2015-04-04 130 views
1

我有這個網站可以刪除繼承的樣式嗎?

http://avocat2.dac-proiect.ro/

你會發現有一個按鈕,「關於我們」 ......後面那個按鈕是從父母遺傳背景爲白色。

我希望背景透明。

如何刪除從父項繼承的樣式?

這是HTML代碼:

<header id="masthead" class="navbar navbar-default" role="banner"> 

<div class="container-fluid"> 

    <div class="row"> 
    <div class="col-sm-12 col-md-12 col-lg-12" style="background:transparent !important;font-size:17px;"> 
     <img src="wp-content/themes/WordPressBootstrap-master/images/DESPRE-NOI.png" class="img-responsive img-center"> 
    </div> 

    </div> 
    <div class="row"> 
    <div class="col-sm-12 col-md-12 col-lg-12" style="background-color:lavender;font-size:17px;"> 
     <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> 
     <p> Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p> 
    </div> 

    </div> 
</div> 

    <div class="container"> 
     <nav class="" role="navigation"> 
<!--   <div class="container-fluid">--> 
       <!-- Brand and toggle get grouped for better mobile display --> 
      <div class="navbar-header"> 
       <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-navbar-collapse-1"> 
        <span class="sr-only">Toggle navigation</span> 
        <span class="icon-bar"></span> 
        <span class="icon-bar"></span> 
        <span class="icon-bar"></span> 
       </button> 




      </div> 

      <!-- Collect the nav links, forms, and other content for toggling --> 
      <div class="collapse navbar-collapse" id="bs-navbar-collapse-1"> 

       <!--   <form class="navbar-form navbar-left" role="search">--> 
       <!--    <div class="form-group">--> 
       <!--     <input type="text" class="form-control" placeholder="Search">--> 
       <!--    </div>--> 
       <!--    <button type="submit" class="btn btn-default">Submit</button>--> 
       <!--   </form>--> 

       <a class="screen-reader-text skip-link" href="#content"><?php _e('Skip to content', 'zdwpbs'); ?></a> 
       <?php 
       wp_nav_menu(array('theme_location' => 'primary' , 
            'menu_class' => 'nav-menu')); 
       ?> 
      </div><!-- /.navbar-collapse --> 
<!--   </div>--> 
    <!-- /.container-fluid --> 
     </nav> 
    </div><!-- .container --> 
</header> 

回答

1

你不能刪除的CSS類的。你可以做的是將導航欄背景覆蓋爲透明(bootstrap爲.navbar默認類提供背景色),併爲孩子添加背景。

<header id="masthead" class="navbar navbar-default" role="banner" style=" 
    background: transparent; 
"> 

<div class="container-fluid"> 

    <div class="row"> 
    <div class="col-sm-12 col-md-12 col-lg-12" style="font-size:17px;"> 
     <img src="wp-content/themes/WordPressBootstrap-master/images/DESPRE-NOI.png" class="img-responsive center-block"> 
    </div> 

    </div> 
    <div class="row"> 
    <div class="col-sm-12 col-md-12 col-lg-12" style="background-color:lavender;font-size:17px;"> 
     <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> 
     <p> Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p> 
    </div> 

    </div> 
</div> 

    <div class="container" style=" 
    background: white; 
    width: 100%; 
    padding-top: 30px; 
    margin-top: 0px; 
"> 
     <nav class="" role="navigation"> 
<!--   <div class="container-fluid">--> 
       <!-- Brand and toggle get grouped for better mobile display --> 
      <div class="navbar-header"> 
       <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-navbar-collapse-1"> 
        <span class="sr-only">Toggle navigation</span> 
        <span class="icon-bar"></span> 
        <span class="icon-bar"></span> 
        <span class="icon-bar"></span> 
       </button> 




      </div> 

      <!-- Collect the nav links, forms, and other content for toggling --> 
      <div class="collapse navbar-collapse" id="bs-navbar-collapse-1"> 

       <!--   <form class="navbar-form navbar-left" role="search">--> 
       <!--    <div class="form-group">--> 
       <!--     <input type="text" class="form-control" placeholder="Search">--> 
       <!--    </div>--> 
       <!--    <button type="submit" class="btn btn-default">Submit</button>--> 
       <!--   </form>--> 

       <a class="screen-reader-text skip-link" href="#content">Skip to content</a> 
       <div class="menu-menu-container"><ul id="menu-menu" class="nav-menu"><li id="menu-item-6" class="menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-2 current_page_item menu-item-6"><a href="http://avocat2.dac-proiect.ro/" class="menu-image-title-hide menu-image-hovered"><span class="menu-image-hover-wrapper"><img width="46" height="48" src="http://avocat2.dac-proiect.ro/wp-content/uploads/2015/03/HOME.png" class="menu-image menu-image-title-hide" alt="HOME"><img width="46" height="48" src="http://avocat2.dac-proiect.ro/wp-content/uploads/2015/03/HOME2.png" class="hovered-image menu-image-title-hide" alt="HOME2" style="margin-left: -46px;"></span></a></li> 
<li id="menu-item-31" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-31"><a href="http://avocat2.dac-proiect.ro/?page_id=17" class="menu-image-title-hide menu-image-hovered"><span class="menu-image-hover-wrapper"><img width="67" height="48" src="http://avocat2.dac-proiect.ro/wp-content/uploads/2015/03/AVOCATI.png" class="menu-image menu-image-title-hide" alt="AVOCATI"><img width="67" height="48" src="http://avocat2.dac-proiect.ro/wp-content/uploads/2015/03/AVOCATI2.png" class="hovered-image menu-image-title-hide" alt="AVOCATI2" style="margin-left: -67px;"></span></a></li> 
<li id="menu-item-29" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-29"><a href="http://avocat2.dac-proiect.ro/?page_id=21" class="menu-image-title-hide menu-image-hovered"><span class="menu-image-hover-wrapper"><img width="60" height="48" src="http://avocat2.dac-proiect.ro/wp-content/uploads/2015/03/CLIENTI.png" class="menu-image menu-image-title-hide" alt="CLIENTI"><img width="60" height="48" src="http://avocat2.dac-proiect.ro/wp-content/uploads/2015/03/CLIENTI2.png" class="hovered-image menu-image-title-hide" alt="CLIENTI2" style="margin-left: -60px;"></span></a></li> 
<li id="menu-item-28" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-28"><a href="http://avocat2.dac-proiect.ro/?page_id=23" class="menu-image-title-hide menu-image-hovered"><span class="menu-image-hover-wrapper"><img width="78" height="48" src="http://avocat2.dac-proiect.ro/wp-content/uploads/2015/03/ONORARII.png" class="menu-image menu-image-title-hide" alt="ONORARII"><img width="78" height="48" src="http://avocat2.dac-proiect.ro/wp-content/uploads/2015/03/ONORARII2.png" class="hovered-image menu-image-title-hide" alt="ONORARII2" style="margin-left: -78px;"></span></a></li> 
<li id="menu-item-30" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-30"><a href="http://avocat2.dac-proiect.ro/?page_id=19" class="menu-image-title-hide menu-image-hovered"><span class="menu-image-hover-wrapper"><img width="186" height="48" src="http://avocat2.dac-proiect.ro/wp-content/uploads/2015/03/DOMENII-DE-EXPERTIZA.png" class="menu-image menu-image-title-hide" alt="DOMENII-DE-EXPERTIZA"><img width="186" height="48" src="http://avocat2.dac-proiect.ro/wp-content/uploads/2015/03/DOMENII-DE-EXPERTIZA2.png" class="hovered-image menu-image-title-hide" alt="DOMENII-DE-EXPERTIZA2" style="margin-left: -186px;"></span></a></li> 
<li id="menu-item-27" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-27"><a href="http://avocat2.dac-proiect.ro/?page_id=25" class="menu-image-title-hide menu-image-hovered"><span class="menu-image-hover-wrapper"><img width="75" height="48" src="http://avocat2.dac-proiect.ro/wp-content/uploads/2015/03/CONTACT.png" class="menu-image menu-image-title-hide" alt="CONTACT"><img width="75" height="48" src="http://avocat2.dac-proiect.ro/wp-content/uploads/2015/04/CONTACT2.png" class="hovered-image menu-image-title-hide" alt="CONTACT2" style="margin-left: -75px;"></span></a></li> 
</ul></div>   </div><!-- /.navbar-collapse --> 
<!--   </div>--> 
    <!-- /.container-fluid --> 
     </nav> 
    </div><!-- .container --> 
</header> 
2

你可以添加一個CSS類的公司簡介元素和覆蓋顏色:

{background-color: transparent !important;}

,或者你可以通過添加做內聯:

style="background-color: transparent;" 

到元素直接在html標記上,如下所示:

<div style="background-color: transparent;">Content</div>