惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
News and Events Feed by Topic
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
T
Threat Research - Cisco Blogs
Cloudbric
Cloudbric
Recent Commits to openclaw:main
Recent Commits to openclaw:main
I
Intezer
Attack and Defense Labs
Attack and Defense Labs
P
Privacy International News Feed
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
L
Lohrmann on Cybersecurity
C
Cybersecurity and Infrastructure Security Agency CISA
V2EX - 技术
V2EX - 技术
AWS News Blog
AWS News Blog
O
OpenAI News
L
LINUX DO - 最新话题
N
News | PayPal Newsroom
PCI Perspectives
PCI Perspectives
www.infosecurity-magazine.com
www.infosecurity-magazine.com
T
Troy Hunt's Blog
Latest news
Latest news
D
Darknet – Hacking Tools, Hacker News & Cyber Security
A
Arctic Wolf
Spread Privacy
Spread Privacy
G
GRAHAM CLULEY
T
Tor Project blog
博客园_首页
Know Your Adversary
Know Your Adversary
有赞技术团队
有赞技术团队
S
Secure Thoughts
美团技术团队
Apple Machine Learning Research
Apple Machine Learning Research
爱范儿
爱范儿
T
Tailwind CSS Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
V
Visual Studio Blog
J
Java Code Geeks
Cisco Talos Blog
Cisco Talos Blog
Schneier on Security
Schneier on Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Security Affairs
Jina AI
Jina AI
人人都是产品经理
人人都是产品经理
雷峰网
雷峰网
宝玉的分享
宝玉的分享
量子位
Last Week in AI
Last Week in AI
月光博客
月光博客
罗磊的独立博客
S
SegmentFault 最新的问题

Taxodium

請開啟 JavaScript 以繼續搜尋 近期觀影 小象超市鮮啤簡評 Zine#54 TIL: lang 属性會影响文字的尺寸 Zine#53 Elfeed 4.0.0 使用分享 分享一些 Zen 瀏覧器好用的功能 Zine#52 Zine#51 Album#42 上手倉頡輸入法 Album#41 Zine#50 Album#40 导出 Elfeed 选中条目到 GitHub Page 作为 Reading List Zine#49 Album#39 Album#38 Album#37 Zine#48 日常#13 Album#36 Album#35 Album#34 在 Emacs 中用 Elfeed 阅读订阅流
TIL: 移除图片下方多余的空白
Spike Leung · 2026-05-19 · via Taxodium

在当前场景下我并不想要這点多余的空白,可以通過以下方法解决:

1.將图片設為 display: block; ,变成块级元素,不再是行內元素,也就不受基线影响

<div style="border: 2px solid;">
  <img style="display:block;" src="/images/album/20251226T172918--梦想家-the-dreamer__20241018_khalilfong_albumwall_image_方大同.webp" />
</div>


2.給图片容器設置 line-height: 0; ,行高為 0,基线底部也不存在高度

<div style="border: 2px solid; line-height: 0;">
  <img src="/images/album/20251226T172918--梦想家-the-dreamer__20241018_khalilfong_albumwall_image_方大同.webp" />
</div>


3.給图片設置 vertical-align: top; /​* or bottom *​/ ,不和基线对齐,和行的上下边䧘对齐

<div style="border: 2px solid;">
  <img style="vertical-align: top;" src="/images/album/20251226T172918--梦想家-the-dreamer__20241018_khalilfong_albumwall_image_方大同.webp" />
</div>

你可以基于使用场景选择合适的方案,我一般会用 vertical-align: top; ,应该是其中副作用最小的。