如何对齐文本的图像和iframe?

时间:2016-08-19 14:55:53

标签: html css

如何让iframe显示在图像下方并向右对齐?这是我的代码。

<img src="images/pc-mag.png" width="500" height="275" align="right">
<iframe width="500" height="400" align="right" src="https://www.youtube.com/embed/9rR5PpHSoIQ" frameborder="0"></iframe>

<h3 class="subHD">SubTitle</h3>
<p>Body paragraph</p>

3 个答案:

答案 0 :(得分:0)

    There are two image tags, not sure under which image tag you want to align iframe?

    Suggestion: You can wrap your iframe in paragraph tag and can align anywhere you want.

    For example: <p style="text-align:right;"> <!--here you can add iframe --> </p> 

答案 1 :(得分:0)

检查jsfiddle iframe imgdiviframe,img{ float:right; } div{ clear:both; }

forceCollide

答案 2 :(得分:0)

Thank you for the help. Here's the code that worked. 

<div class="FullPage">

<!--container for image and iframe -->
<div style="float:right; margin-left:20px">
<img src="images/pc-mag.png" width="500" height="275" align="right"><br>
<iframe width="500" height="400" align="right" style="margin-top:20px" src="https://www.youtube.com/" frameborder="0"></iframe>
</div>

<img src="../images/Logotype.png" width="190" height="101"/>
<h3>Title</h3>
<p>Body text</p>

</div>