简体   繁体   English

如何正确对齐视频,以便我的文字环绕我的垂直视频?

[英]How can I align video right so that my text wraps around my vertical video?

I have been trying to find a way to embed some video footage into a blog post and have it align to the right of the page and have text wrap around it.我一直在尝试找到一种方法将一些视频片段嵌入到博客文章中,并将其与页面右侧对齐并在其周围添加文字。

This is what I have written so far to get the video to embed, but I can't see to figure out how to get it to align right.到目前为止,这是我为嵌入视频而编写的内容,但我无法弄清楚如何使其正确对齐。

This is the first time I have to look into the code part of my site as so much of it is very easy using Wordpress so this has stumped me a bit.这是我第一次必须查看我网站的代码部分,因为使用 Wordpress 非常容易,所以这让我有点难受。

Ive tried using class="right" which I found after a few mins googling but no luck, so I thought It would be better come just come here to have to hopefully explained properly.我试过使用 class="right" ,我在谷歌搜索了几分钟后发现但没有运气,所以我认为最好来这里有希望得到正确解释。

<span> Various text above this code </span>

<video width="270" height="480" controls>
      <source src="VIDEO URL" type="video/mp4">
    </video>

<span> Various text below this code </span>

This works as expected, the video embeds perfectly but then when I try to use any type of code which I found online to align it, it just doesn't work.这按预期工作,视频完美嵌入,但是当我尝试使用我在网上找到的任何类型的代码来对齐它时,它就不起作用。

This will likely get the job done:这可能会完成工作:

<video style="float:right" width="270" height="480" controls>
  <source src="VIDEO URL" type="video/mp4">
</video>

Here's an easy and simple solution:这是一个简单而简单的解决方案:

video {
  float: right;
  margin: 0 0 20px 20px;
}
p {text-align: justify;}

Live Demo:现场演示:

 video { float: right; margin: 0 0 20px 20px; } p { text-align: justify; }
 <video width="270" height="480" controls> <source src="VIDEO URL" type="video/mp4"> </video> <p> Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.</p> <p> The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. </p> <p> Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.</p> <p> The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. </p> <p> The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. </p> <p> The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. </p> <p> The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. </p> <p> The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. </p> <p> The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. </p> <p> The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. </p> <p> The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. </p> <p> The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. </p>

Let ME know if this works with you.让我知道这是否适用于您。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM