How to float text next to iframe

2020-04-17 03:42发布

问题:

I'm trying to float text left of an iframe. I have the below, though it will not float. What needs to be changed? Canvas width is 800px

<p class="float-left"></p>
<iframe class="float-right" width="420" height="315" src="//www.youtube.com/embed/" frameborder="0" allowfullscreen></iframe>
<div class="clear"></div>

.float-left {
position: relative;
float: left;
margin: 0px 0px 50px;
width: 250;
height: 100%;
}
.float-right {
float: right;
width: 65%;
}

回答1:

You might not even need float-left class. I have created a jsfiddle. It might be what you are looking for.

http://jsfiddle.net/8dhqs/

<iframe class="float-right" width="420" height="315" src="//www.youtube.com/embed/" 

frameborder="0" allowfullscreen></iframe>
<p>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</p>
<div class="clear"></div>

.float-right {
float: right;
width: 65%;
}


标签: iframe