I have an XML file with the following relevant section
<postText>
<![CDATA[text <br>
stuff<br />
<iframe width='560' height='349' src='http://www.youtube.com/embed/video'
frameborder='0' marginheight='40px' allowfullscreen></iframe>]]>
</postText>
Using php simplexmlloader i am able to print this item however there is no space between the text and the top of the youtube video despite the
tags and the marginheightvariable.
My guess is, that you maybe misinterpreted the attribute
marginheight.The
marginheightattribute does not define the space betweentext <br>stuff<br />and the<iframe>, but the space between the frame’s content and the frame’s top and bottom margin (i.e. inside the iframe).One way to have a vertical space between your text and the iframe element is to wrap the
<iframe>in a<div>and define amargin-topfor the<div>: