如何在Wordpress内容/帖子区域内嵌块,小部件块进入页脚,为什么?

时间:2019-01-20 01:39:14

标签: html css

我正在尝试将可折叠的内容添加到wordpress中,问题是:当我将可折叠的html代码放入我的wordpress模板中时-小部件块从应有的原始位置“运行”(在右侧)一侧,以及帖子的内容(位于左侧)并向下放置在页脚区域中。我测试了不同的位置,显示设置,但没有任何帮助。 具有可折叠内容的页面为here

可折叠的html部分是:

<div class="wrap-collabsible">
 <input id="collapsible" class="toggle" type="checkbox">
  <label for="collapsible" class="lbl-toggle">Read Full Post</label>
  <div class="collapsible-content">
    <div class="content-inner">
      <p>
       This content in collapsible
      </p>
    </div>
  </div>
</div>
</div>  

css部分是:

.wrap-collabsible {
  margin-bottom: 1.2rem 0;
}

input[type='checkbox'] {
  display: none;
}

.lbl-toggle {
  display: block;

  font-weight: bold;
  font-family: monospace;
  font-size: 1.2rem;
  text-transform: uppercase;
  text-align: center;

  padding: 1rem;

  color: #A77B0E;
  background: #FAE042;

  cursor: pointer;

  border-radius: 7px;
  transition: all 0.25s ease-out;
}

.lbl-toggle:hover {
  color: #7C5A0B;
}

.lbl-toggle::before {
  content: ' ';
  display: inline-block;

  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 5px solid currentColor;
  vertical-align: middle;
  margin-right: .7rem;
  transform: translateY(-2px);

  transition: transform .2s ease-out;
}

.toggle:checked + .lbl-toggle::before {
  transform: rotate(90deg) translateX(-3px);
}

.collapsible-content {
  max-height: 0px;
  overflow: hidden;
  transition: max-height .25s ease-in-out;
}

.toggle:checked + .lbl-toggle + .collapsible-content {
  max-height: 350px;
 }

.toggle:checked + .lbl-toggle {
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.collapsible-content .content-inner {
  background: rgba(250, 224, 66, .2);
  border-bottom: 1px solid rgba(250, 224, 66, .45);
  border-bottom-left-radius: 7px;
  border-bottom-right-radius: 7px;
  padding: .5rem 1rem;
}

我尝试对每个div应用不同的显示和位置设置,但是没有按预期工作。 我了解div设置或输入设置有问题。请帮忙。

0 个答案:

没有答案