css - div 中 html 中的图像不会出现在彼此下方(请看图片)?

标签 css html

为什么图像以这种方式出现,..?

    <div id='container'>  
      <div class='imgContainer'>
         <div  class='myLocation'>
              <img src='https://graph.facebook.com/1055505/picture' style='width:30px'>
              Tova Schherr
         </div>
      </div>
      <div class='imgContainer'>
         <div  class='myLocation'>
              <img src='https://graph.facebook.com/1205050/picture' style='width:30px'>
              Alison Carmel
         </div>
      </div>

..... .. 
 ...... 
</div>

您必须知道数据是用于显示示例的样本,因此它不会起作用。

这里是 myLocation 的 CSS 类

.myLocation
{
    margin-bottom:1px;
    width:100%;

    background-color:#F7F7F7;
    color:#006699;
    padding:7px;
    padding-right:12px;
}

enter image description here

最佳答案

也许,您的文档类型需要关闭图像标签。

<img src="" />

关于css - div 中 html 中的图像不会出现在彼此下方(请看图片)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7539406/

相关文章:

php - HTML img 没有改变它的大小

css - :first-child affecting other child elements

用于图像和描述的 jQuery slider

html - 图片前的 CSS 定位元素

javascript - 如何使用innerHTML在<p>标签中显示jquery datepicker值

html - Bootstrap 导航栏透明

css - 水平滚动+滚动条

javascript - 我怎样才能让用户能够点击一个事件来强制他们向下滚动?

html - 使列高度调整为图像响应高度(Flexbox)

html - 如何让背景视频播放