【问题标题】:Align video with Image In html without Css [closed]在没有Css的html中将视频与图像对齐[关闭]
【发布时间】:2021-08-06 04:54:11
【问题描述】:

我想在不使用 CSS 的情况下将左侧的视频和右侧的图像在 html 中的同一行对齐

【问题讨论】:

  • 您能否扩展一下“对齐”的含义 - 图像的底部和视频的底部在同一级别,或者顶部对齐或......?跨度>

标签: html css alignment


【解决方案1】:

如果你不想使用 CSS,你可以试试 Bootstrap 4。它们有很好的 flex 行为:

<div class="d-flex flex-row">
  <div class="p-2">Flex item 1</div> # elements on the left side
</div>
<div class="d-flex flex-row-reverse">
  <div class="p-2">Flex item 1</div> # elements on the right side
</div>

【讨论】:

  • 技术上这使用 CSS
【解决方案2】:

使用 HTML 表格:

<table>
  <tr>
    <td>
      <video src="https://www.w3schools.com/html/movie.mp4" autoplay/>
    </td>
    <td>
      <img src="https://www.gravatar.com/avatar/0fdacb141bca7fa57c392b5f03872176?s=48&d=identicon&r=PG&f=1">
     </td>
  </tr>
</table>

【讨论】:

    【解决方案3】:

    只需使用包含一行和两个单元格的表格。您可以简单地使用 'width' 和 'height' 属性来修改其在页面中的大小。

    <table width="100%" bgcolor="red" height="200px">
    <tr>
        <td bgcolor="green">
            Your video goes here.
        </td>
        <td bgcolor="blue">
            The image goes here.
        </td>
    </tr>
    </table>

    【讨论】:

      猜你喜欢
      • 2021-03-06
      • 1970-01-01
      • 2013-07-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-02
      • 2017-11-23
      相关资源
      最近更新 更多