切换css(显示:无)不在safari上工作

时间:2014-04-23 13:29:40

标签: html css toggle expand

我试图在safari上做这项工作,但无论如何我都无法做到。它在chrome / ff上工作正常。

我试图点击一个展开框,这里是我的代码,提前感谢您的帮助:

<input class="toggle-box" id="header1" type="checkbox" >
<label for="header1">Click here</label>
<span>Lorem ipsum dolor sit amet, consectetuer adipiscing.</span>

的CSS:

<style>
.toggle-box {
  display: none;
}

.toggle-box + label {
  cursor: pointer;
  display: inline;
  margin-bottom: 5px;
}

.toggle-box + label + span {
  display: none;
  margin-bottom: 10px;
}

.toggle-box:checked + label + span {
  display: inline;
}

.toggle-box + label:before {
  background-color: #4F5150;
  -webkit-border-radius: 10px;
  border-radius: 10px;
  -moz-border-radius: 10px;
  color: #FFFFFF;
  content: "+";
  display: block;
  float: left;
  font-weight: bold;
  height: 20px;
  line-height: 20px;
  margin-right: 5px;
  text-align: center;
  width: 20px;
}

.toggle-box:checked + label:before {
  content: "\2212";
}
.rest{
    display: inline!important;
}
</style>

0 个答案:

没有答案