Skip to content

搞英语 → 看世界

翻译英文优质信息和名人推特

Menu
  • 首页
  • 作者列表
  • 独立博客
  • 专业媒体
  • 名人推特
  • 邮件列表
  • 关于本站
Menu

Ghost 中的浮动图像

Posted on 2024-12-02

标志.webp

Ghost中没有内置方法可以使图像浮动并使文本围绕图像流动。这是一个重大的遗漏,他们说这个遗漏“太难了”并且没有计划改变。好吧好吧,我自己来吧。

我在论坛上的这篇文章中找到了一个合理的解决方案。这是我的使用方法。

在代码注入区域的头部添加以下内容:

 /* small images to float but not look stupid on mobile */ @ media ( min-width : 40rem ) {   
. float-left-half figure , . float-left-two-thirds figure { float : left ; margin : 8 px 20 px 6 px 0 ; } . float-right-half figure , . float-right-two-thirds figure { float : right ; margin : 8 px 0 6 px 20 px ; } . float-left-half figure , . float-right-half figure { max-width : 50 % ; } @ media ( min-width : 64em ) { . float-left-two-thirds figure , . float-right-two-thirds figure { max-width : 67 % ; } }   
}

然后,在帖子或页面中,我在要浮动的图像卡之前添加一个 HTML 块(例如向右)。

 <span class="float-right-half">

然后关闭图像卡后的</span> 。

原文: https://baty.net/2024/11/floating-images-in-ghost/

本站文章系自动翻译,站长会周期检查,如果有不当内容,请点此留言,非常感谢。
  • Abhinav
  • Abigail Pain
  • Adam Fortuna
  • Alberto Gallego
  • Alex Wlchan
  • Answer.AI
  • Arne Bahlo
  • Ben Carlson
  • Ben Kuhn
  • Bert Hubert
  • Bits about Money
  • Brian Krebs
  • ByteByteGo
  • Chip Huyen
  • Chips and Cheese
  • Christopher Butler
  • Colin Percival
  • Cool Infographics
  • Dan Sinker
  • David Walsh
  • Dmitry Dolzhenko
  • Dustin Curtis
  • Elad Gil
  • Ellie Huxtable
  • Ethan Marcotte
  • Exponential View
  • FAIL Blog
  • Founder Weekly
  • Geoffrey Huntley
  • Geoffrey Litt
  • Greg Mankiw
  • Henrique Dias
  • Hypercritical
  • IEEE Spectrum
  • Investment Talk
  • Jaz
  • Jeff Geerling
  • Jonas Hietala
  • Josh Comeau
  • Lenny Rachitsky
  • Liz Danzico
  • Lou Plummer
  • Luke Wroblewski
  • Matt Baer
  • Matt Stoller
  • Matthias Endler
  • Mert Bulan
  • Mostly metrics
  • News Letter
  • NextDraft
  • Non_Interactive
  • Not Boring
  • One Useful Thing
  • Phil Eaton
  • Product Market Fit
  • Readwise
  • ReedyBear
  • Robert Heaton
  • Ruben Schade
  • Sage Economics
  • Sam Altman
  • Sam Rose
  • selfh.st
  • Shtetl-Optimized
  • Simon schreibt
  • Slashdot
  • Small Good Things
  • Taylor Troesh
  • Telegram Blog
  • The Macro Compass
  • The Pomp Letter
  • thesephist
  • Thinking Deep & Wide
  • Tim Kellogg
  • Understanding AI
  • 英文媒体
  • 英文推特
  • 英文独立博客
©2025 搞英语 → 看世界 | Design: Newspaperly WordPress Theme