CSS锚标签不会继承显示

时间:2018-12-08 02:38:55

标签: html css twitter-bootstrap

我一直在尝试将锚标记添加到display: inherit,但是它不会改变。我还添加了!important,但它仍然不会更改定位标记的显示。这是我的代码:

div.et_pb_blurb_container {
  background: white;
  padding: 15px 15px 0;
  width: 90%;
  margin: -80px auto 0;
  position: relative;
  border: 1px solid #dedede;
  line-height: 1.7em !important;
}

#blurbbutton {
  background: #151d3f;
  display: inherit !important;
  margin: 0 -15px;
  color: white;
  padding: 15px 0;
  text-transform: uppercase;
  font-size: 15px;
  width: 100% !important;
  line-height: 1.7em;
}

p { all: initial !important; }
<div class="et_pb_blurb_container">
  <div class="et_pb_blurb_description">

    <h4>This is a great website</h4>
    <p><a id="blurbbutton" href="www.google.com">Click the link here</a></p>

  </div>
  <!-- .et_pb_blurb_description -->

</div>

如果anchor标签要继承其容器的大小,则它将起作用。但是,由于某些原因,无法将display: inherit添加到#blurbbutton的CSS中。

1 个答案:

答案 0 :(得分:0)

最初,我设置p {all:initial!important; }。这正在影响锚点正确继承。现在,在我的chrome开发人员工具中,我可以删除“ display:Inherit”属性,并且该属性生效。

相关问题