将div定位在高度动态变化的绝对图片下方

5
我的问题是将一个div定位在一个“动态图片”下面,并在该div下方放置动态内容: 链接到jsfiddle 准备填写的jsfiddle css类:
1. .belowPicture 2. .belowBelowPicture HTML代码:
    <div id="wallDetailContent">     
  <section id="wallDetailMessage" style="width 100%"> 
     <img class="wallDetailPicture" src="http://web.scott.k12.va.us/martha2/dmbtest.gif">
     <div style="max-width:70%;">blah gik sig en tur, og købte blah med hjem</div>
  </section>
  <section class="belowPicture">
    <p class="wallByDate"> 20140126220550</p> 
    <p class="wallByBy"> af &nbsp; </p>
    <p class="wallByName"> Anders  </p>
  </section>
  <section class="belowBelowPicture">
      content (should be dynamic, able to fill all the height it need downwards.)
  </section>
</div>

css:

.wallDetailPicture{
    top: 5px;
    right : 5px;
    position: absolute;
    display:box;
    width:auto;
    height:auto;
    max-width:30%;
    max-height: 200px;
}
.wallByName{
    font-weight: bold !important; 
    color: blue;
    display:inline-block !important;
}
.wallByDate{
    font-weight: bold !important; 
    display:inline-block !important;
}
.wallByBy{
    display:inline-block !important;
}
.belowPicture{
     background:red;
}
.belowBelowPicture{
    background:green;

}

目标外观:目标图像

如果您想对齐文本,为什么不将wallDetailMessage部分设置为绝对定位而不是图片呢?有什么原因吗? - Kuzgun
1个回答

5

没问题。如果你正在开发一个基于网格的布局,建议你可以考虑使用Bootstrap(http://getbootstrap.com/)和Foundation(http://foundation.zurb.com/)而不是从头开始构建。 - Sinister Beard

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接