我想将此幻灯片放映在中央,但不幸的是,它不起作用。我为此使用了内联 CSS。
我试过添加display:inline-block;
和width:100%;text-align:center;
,还是不行。我也试过 text-align:center;
这是我正在处理的代码。在这方面我很愚蠢,我在我的网站上遇到了困难,除非完成,否则无法提交我的元素。
<div class="cincopa_responsive_iframe" style="padding:56.25% 0 0 0;position:relative;">
<div class="cincopa_responsive_wrapper" style="height:100%;left:0;position:absolute;top:0;width:100%;">
<iframe width="100%" height="100%" src="//www.cincopa.com/media-platform/iframe.aspx?fid=AMNAChemJPN0" frameborder="0" allowfullscreen scrolling="no">
</iframe>
</div>
</div>
幻灯片出现在左上角。我希望它位于中心。这是它的外观图片:https://imgur.com/a/F1uNDPW
最佳答案
在 iframe 中还有另一个 html 代码不能用 Css 操作,可能是用 js ..当你在 iframes/#documents/body 中使用 DevTools 检查时,有 #_wp_cincopa_1 如果设置“margin-left:auto; margin -右:汽车;”可以看到变化..
关于html - 如何将 div 和 iframe 置于中心?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57330121/