javascript - 将文本放在 youtube iframe 的右侧

标签 javascript html css iframe

我对 HTML 和 CSS 非常陌生。 我想在 youtube iframe 的右侧放置一些文本。 我已经尝试过这段代码

.text {
  float: right;
}
<iframe width="200" height="100" src="//www.youtube.com/embed/" frameborder="0" allowfullscreen></iframe>
<span class="text">Hello This is some textHello This is some textHello This is some textHello This is some textHello This is some textHello This is some textHello This is some textHello This is some textHello This is some textHello This is some textHello This is some textHello This is some textHello This is some textHello This is some text</span>

但这会从新行开始文本。我想从 iframe 的右上角空间开始文本。 请帮助我如何实现这一目标?

最佳答案

宽度赋予.text

.text {
  float: right;
  width:50%;
}
<iframe width="200" height="100" src="//www.youtube.com/embed/" frameborder="0" allowfullscreen></iframe>
<span class="text">Hello This is some textHello This is some textHello This is some textHello This is some textHello This is some textHello This is some textHello This is some textHello This is some textHello This is some textHello This is some textHello This is some textHello This is some textHello This is some textHello This is some text</span>

关于javascript - 将文本放在 youtube iframe 的右侧,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33844930/

相关文章:

javascript - 具有回调函数的 AJAX

javascript - 使用 Edge 和 Safari 浏览器在网格内溢出

PHP截断时出现 fatal error

html - 网站布局 : Shall I use CSS-width with percentage or flexbox?

html css代码并排打印预览两个表

html - 删除::after 选择器中的样式

JavaScript 在不透明度转换完成之前更改图像

javascript - useRef 当前仅在第二次更新时获取其值

java - 如何将 Java 后端与 html/css 前端连接起来?

html - 如何在伪元素旁边制作一个箭头:hover::before 元素