【问题标题】:How to make text on the side of multiple Images HTML如何在多个图像 HTML 的一侧制作文本
【发布时间】:2020-09-11 04:12:12
【问题描述】:

所以我尝试了float(使下一个图像出现在第一个图像旁边)和旧的对齐方法(创建 1 行,然后下一个位于图像下方),有什么想法吗? CSS 只有一个margin-left (而且所有图片都是占位符)

<div class="main">
  <br/>
  <br/>
  <br/>
  <br/>
  <hr style="height:2px;border-width:0;color:gray;background-color:gray">


  <img src="Night11.png" alt="Blur" style="width:400px;height:400px;"> Testword1 Testword2 Testword3 Testword4


  <hr style="height:2px;border-width:0;color:gray;background-color:gray">


  <img src="Night11.png" alt="Blur" style="width:400px;height:400px;">


  <hr style="height:2px;border-width:0;color:gray;background-color:gray">


  <img src="Night11.png" alt="Blur" style="width:400px;height:400px;">


  <hr style="height:2px;border-width:0;color:gray;background-color:gray">


  <img src="Night11.png" alt="Blur" style="width:400px;height:400px;">


  <hr style="height:2px;border-width:0;color:gray;background-color:gray">


  <img src="Night11.png" alt="Blur" style="width:400px;height:400px;">


  <hr style="height:2px;border-width:0;color:gray;background-color:gray">


  <img src="Night11.png" alt="Blur" style="width:400px;height:400px;">
</div>

【问题讨论】:

    标签: html css image text css-float


    【解决方案1】:

    如果您希望浮动图像显示在彼此下方,但仍允许文本在其周围流动,请在其上使用clear: both(或clear: leftclear: right,在某些情况下)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-11-30
      • 2018-11-22
      • 2020-03-28
      • 1970-01-01
      • 2022-10-31
      • 1970-01-01
      • 2020-04-23
      • 2022-10-14
      相关资源
      最近更新 更多