我对 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/