首页 > 解决方案 > 用浮动包装文本:权利不适用于 itch.io

问题描述

我在 itch.io 上的网站有问题。所以,我有一个嵌入(这里用带有冰箱标志的蓝色矩形表示),我想把它放在下面文本的右边。 在此处输入图像描述

嵌入的代码是这样的:

<iframe loading="lazy" src="[source]" 
style="border:0px #FFFFFF none;float:right" name="browserGame" scrolling="no" frameborder="0" 
marginheight="0px" marginwidth="0px" height="210px" width="310px" allowfullscreen=""></iframe>

如您所见,我尝试使用 float:right,因为它实际上是设计用于环绕内容的文本,但由于某种原因它不起作用。

奇怪的是,在编辑设置中的页面预览中,一切正常,如下图所示: 在此处输入图像描述

这是完整的 HTML(不包括顶部的三个链接,这里没有错误),以防它有一些用处:

<iframe loading="lazy" src="[source]" 
style="border:0px #FFFFFF none;float:right" name="browserGame" scrolling="no" frameborder="0" 
marginheight="0px" marginwidth="0px" height="210px" width="310px" allowfullscreen=""></iframe>
<h5 style="color:#dd4a4a"><em>THE COZIEST PLACE FOR THE CRAZIEST GAMES</em></h5>
<p>Greetings, kind guest, and welcome to our humble pub.<br></p>
<p>We're a small development team from Italy and we always wish the best experience to our guests, from our other places you can visit to our products.</p>
<p>You can see more information about our debut game, <span style="color:#dd4a4a">Carboncino's Inferno</span>, down below.</p>

关于这个问题的最后一条信息是,它似乎是一个 itch.io 问题,因为这个确切的代码在本地 html 文件上完美运行。

标签: htmlcsstextcss-floatembed

解决方案


我做的!对于 itch.io 有类似问题的任何人,在 HTML 和 CSS 中使用自定义类时,请始终记住custom-在类名之前使用。所以对我来说,这就是诀窍:

<div class="custom-embed"><iframe loading="lazy" src="[source]" 
style="border:0px #FFFFFF none;float:right" name="browserGame" scrolling="no" frameborder="0" 
marginheight="0px" marginwidth="0px" height="210px" width="310px" allowfullscreen=""></iframe></div>

然后在自定义 CSS 编辑器中:

.custom-embed{float:right}

推荐阅读