2015-04-01 135 views
0

我很好奇,如果有一種簡單的方法可以使標籤採用CSS樣式屬性的默認值。我的複選框正在使用我的選項卡的屬性,我只是希望它們成爲默認值。正如你將看到的,我改變了複選框的字體大小,使它小於製表符。但是,我不想寫CSS來取消選項卡的樣式。我知道我錯過了一些東西。謝謝。HTML/CSS標籤:考慮其他標籤屬性的標籤

enter image description here

的CSS標籤:

  .tabs label { 
      box-shadow: 0px 4px 10px #888888; 
      display: block; 
      padding: 10px 20px; 
      border-radius: 2px 2px 0 0; 
      color: #207cca; 
      font-size: 20px; 
      font-weight: normal; 
      font-family: Impact, Verdana, sans-serif; 
      background: rgba(255,255,255,0.2); 
      cursor: pointer; 
      position: relative; 
      -webkit-transition: all 0.5s ease-in-out; 
      -moz-transition: all 0.5s ease-in-out; 
      -o-transition: all 0.5s ease-in-out; 
      transition: all 0.5s ease-in-out; 
     } 

CSS的複選框:

  #sidebar label { 
      font-size: 10px; 

     } 

HTML標籤:

<ul class="tabs"> 
     <li> 
      <input type="radio" checked name="tabs" id="tab1"> 
      <label for="tab1">Resource Browser</label> 
      <div id="tab-content1" class="tab-content animated fadeIn"> 

HTML複選框:

<div id="sidebar" class="sidebar"> 
       <form action="/result/" method="get"> 
        <p> Demographics </p> 
        <input type="checkbox" name="male" value="selected" id="g_male" /> 
        <label for="g_male">male</label><br> 
        <input type="checkbox" name="female" value="selected" id="g_female" /> 
        <label for="g_female">female</label><br> 
        <input type="checkbox" name="age1-3" value="selected" id="age1-3" /> 
        <label for="age1-3">Age 1-3</label><br> 
        <input type="checkbox" name="age3-18" value="selected" id="age3-18" /> 
        <label for="age3-18">Age 3-18</label><br> 
        <input type="checkbox" name="age18+" value="selected" id="age18+" /> 
        <label for="age18+">Age 18+</label><br> 

回答

0

您可以通過執行直接針對標籤:

.tabs > li > label { 
    /* CSS here... */ 
} 

#sidebar > form > label { 
    /* CSS here... */ 
} 
+0

謝謝!我會試一試並回復你。 – Edge 2015-04-02 00:31:14