2014-01-27 63 views
1

我目前使用手风琴,我发现。在手风琴内添加表格

这里是CSS:

 .ac-container{ 
      width: 400px; 
      margin: 10px auto 30px auto; 
     } 

     .ac-container label{ 
      font-family: 'BebasNeueRegular', 'Arial Narrow', Arial, sans-serif; 
      padding: 5px 20px; 
      position: relative; 
      z-index: 20; 
      display: block; 
      height: 30px; 
      cursor: pointer; 
      color: #777; 
      text-shadow: 1px 1px 1px rgba(255,255,255,0.8); 
      line-height: 33px; 
      font-size: 19px; 
      background: linear-gradient(top, #ffffff 1%,#eaeaea 100%); 
      box-shadow: 
       0px 0px 0px 1px rgba(155,155,155,0.3), 
       1px 0px 0px 0px rgba(255,255,255,0.9) inset, 
       0px 2px 2px rgba(0,0,0,0.1); 
      background: none repeat scroll 0 0 #F8F7F5; 
     } 

     .ac-container label:hover{ 
      background: #fff; 
     } 

     .ac-container input:checked + label, 
     .ac-container input:checked + label:hover{ 
      background: #c6e1ec; 
      color: #3d7489; 
      text-shadow: 0px 1px 1px rgba(255,255,255, 0.6); 
      box-shadow: 
       0px 0px 0px 1px rgba(155,155,155,0.3), 
       0px 2px 2px rgba(0,0,0,0.1); 
     } 

     .ac-container label:hover:after, 
     .ac-container input:checked + label:hover:after{ 
      content: ''; 
      position: absolute; 
      width: 24px; 
      height: 24px; 
      right: 13px; 
      top: 7px; 
      background: transparent url(../images/arrow_down.png) no-repeat center center; 
     } 

     .ac-container input:checked + label:hover:after{ 
      background-image: url(../images/arrow_up.png); 
     } 

     .ac-container input{ 
      display: none; 
     } 

     .ac-container article{ 
      background: rgba(255, 255, 255, 0.5); 
      margin-top: -1px; 
      overflow: hidden; 
      height: 0px; 
      position: relative; 
      z-index: 10; 
      transition: 
       height 0.3s ease-in-out, 
       box-shadow 0.6s linear; 
     } 
     .ac-container input:checked ~ article{ 
      transition: 
       height 0.5s ease-in-out, 
       box-shadow 0.1s linear; 
      box-shadow: 0px 0px 0px 1px rgba(155,155,155,0.3); 
     } 

     .ac-container article p{ 
      font-style: italic; 
      color: #777; 
      line-height: 23px; 
      font-size: 14px; 
      padding: 20px; 
      text-shadow: 1px 1px 1px rgba(255,255,255,0.8); 
     } 

     .ac-container input:checked ~ article.ac-small{ 
      height: 440px; 
     } 
     .ac-container input:checked ~ article.ac-medium{ 
      height: 180px; 
     } 
     .ac-container input:checked ~ article.ac-large{ 
      height: 230px; 
     } 

这里是HTML代码:

 <section class="ac-container">  
      <div> 
       <input id="ac-1" name="accordion-1" type="checkbox" /> 
       <label for="ac-1">Available options </label> 
       <article class="ac-small"> 
       <form name="myform" action="http://www.mydomain.com/myformhandler.cgi" method="POST"> 
        <div align="center"><br> 
        <input type="radio" name="group1" value="Milk"> Milk<br> 
        <input type="radio" name="group1" value="Butter" checked> Butter<br> 
        <input type="radio" name="group1" value="Cheese"> Cheese 
        </div> 
       </form> 
       </article> 
      </div> 
      <div><!--...--></div> 
     </section> 

不幸的是,我无法看到里面手风琴的单选按钮(当我下拉“可用选项“),但我可以看到这些项目。我做错什么了吗 ?

+1

你可能没有看到的复选框要么因为你定义你的投入不是,你有.AC容器输入的CSS显示{显示:无;} – FabioG

+1

如果我的答案是您正在寻找的答案,请点击上方答案内容左侧的复选标记将其标记为已接受。这会向其他人展示此问题已得到解答,并且如果其他人可能最终出现在此页面上,它还会向他们展示此答案就是您要查找的内容。如果这不是你需要的答案,你可以添加一条评论,解释哪些仍然不正确。 – Joeytje50

回答

2

这里的问题在于CSS3手风琴在复选框输入上使用动态:checked伪类。点击“手风琴标题”切换复选框的选中状态,然后切换手风琴内容的风格。要删除虽然复选框,手风琴具有以下样式:

.ac-container input { 
    display: none; 
} 

这也继承了在表单中的输入。您可以通过只覆盖该样式解决这个问题:

.ac-container form input { 
    display:inline; 
} 
+0

谢谢,我应该在提问前完整阅读css,对不起,我的不好。 – Exia0890

+0

嗯,我不会说你实际上必须检查导入/复制的CSS中的所有内容,但如果出现问题,你可以检查是否有任何干扰样式。您也可以通过按F12或右键单击元素(或靠近元素的元素)并选择“检查元素”来检查Chrome中的开发工具。在随后出现的菜单中,浏览所看到的元素,直到您选择了您想查看样式的元素,然后查看右侧以查看适用于其的样式。 – Joeytje50

+0

我看到了,谢谢你的提示。 – Exia0890