【问题标题】:Wrapping text with float: right not working on itch.io用浮动包装文本:权利不适用于 itch.io
【发布时间】:2021-08-16 18:20:30
【问题描述】:

我在 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 文件上完美运行。

【问题讨论】:

    标签: html css text css-float embed


    【解决方案1】:

    我做到了!对于 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}
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-13
      • 1970-01-01
      • 2013-07-16
      • 1970-01-01
      • 1970-01-01
      • 2019-01-13
      相关资源
      最近更新 更多