Как я могу выровнять видео так, чтобы мой текст обернулся вокруг моего вертикального видео? - PullRequest
0 голосов
/ 05 января 2019

Я пытался найти способ встроить некоторые видеоматериалы в сообщение блога, выровнять его по правому краю страницы и обернуть вокруг него текстом.

Это то, что я написал до сих пор, чтобы вставить видео, но я не могу понять, как заставить его выравниваться правильно.

Это первый раз, когда мне приходится заглядывать в кодовую часть моего сайта, так как многие из них очень просты с использованием Wordpress, поэтому это немного озадачило меня.

Я пытался использовать class = "right", которое я нашел после нескольких минут поиска в Google, но безуспешно, поэтому я подумал, что было бы лучше прийти сюда, чтобы, надо надеяться, правильно объяснить.

<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>

Это работает, как и ожидалось, видео отлично встраивается, но потом, когда я пытаюсь использовать любой тип кода, который я нашел в Интернете, чтобы выровнять его, оно просто не работает.

Ответы [ 2 ]

0 голосов
/ 06 января 2019

Вот простое и простое решение:

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

Демонстрация в реальном времени:

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>

Дайте мне знать, если это работает с вами.

0 голосов
/ 06 января 2019

Скорее всего, это будет сделано:

<video style="float:right" width="270" height="480" controls>
  <source src="VIDEO URL" type="video/mp4">
</video>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...