绝对div之后的CSS相对div

时间:2016-11-04 17:18:12

标签: html css inheritance css-position absolute


我是一个绝对的div,我不能在相对div中转换,否则children元素不会继承height参数。



.tile-project-internal-box {
  padding: 0;
  position: relative;
  min-height: 1070px;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0px 2px 15px #888888;
}
.tile-project-img {
  position: absolute;
  width: 100%;
  height: 50%;
  overflow: hidden;
  border-radius: 10px;
}
.tile-project-img:after {
  display: block;
  content: ' ';
  clear: both;
}
.tile-project-internal-box .tile-project-img-horizontal-responsive {
  min-width: 100%;
  max-width: none;
  min-height: 100%;
  max-height: 100%;
  border-radius: 5px;
}
.tile-project-internal-box .tile-project-img-vertical-responsive {
  min-width: 100%;
  max-width: 100%;
  min-height: 100%;
  max-height: none;
  border-radius: 5px;
}
.tile-project-informations {
  position: relative;
}

<div class='col-md-12 tile-project-internal-box'>
  <div class='tile-project-img'>
    <img src='https://cdn3.vox-cdn.com/uploads/chorus_asset/file/7174567/shutterstock_128724608.jpg' alt='$projectImageAlt' class='$imgClass'>
  </div>
  <div class='tile-project-informations'>
    <h3 class='tile-project-title'>$projectTitle</h3>
    <p class='tile-project-author'>Autore Progetto</p>
    <p class='tile-project-abstract'>$projectAbstract</p>
    <div class='tile-project-other'>
      <p class='tile-project-place-and-tag'>Roma, Italia | #Arte, #Pittura</p>
      <p>-----------------</p>
      <p class='tile-project-founding-percentage'>
        <span>45%</span>
        <br>Finanziato
      </p>
      <p class='tile-project-founding-amount'>
        <span>&euro; 1.200.000</span>
        <br>Pledged
      </p>
      <p class='tile-project-founding-days'>
        <span>$daysLeft</span>
        <br>Giorni Rimasti
      </p>
    </div>
  </div>
</div>
&#13;
&#13;
&#13;

正如您在CSS代码中看到的,我也尝试使用内容=&#39; &#39;和清除=两者。
我该怎么解决呢? 我应该在图像下面有文字而不是下面。
谢谢!

0 个答案:

没有答案