做商品详情页的时候,发现详情图多张的情况下,即使设置了 margin:0;padding:0 也不能让两张图片上下之间没有空隙。

原因是 img 标签是行内元素,默认的图片对齐方式为 vertical-align: baseline;,即基线对齐。baseline 对其方式导致图片并不是与 div 的真实底部对齐,而是与文基线对齐。文基线就是字母 x 的下边缘,即使没有文字,也会有空隙。

解决办法

- 阅读剩余部分 -

macOS 升级到 14.0 Sonoma 之后,发现 brew 安装的 nginx 无法启动了。

sudo brew services list 查看状态:

nginx error  256 root /Library/LaunchDaemons/homebrew.mxcl.nginx.plist

手动启动之:

$ sudo brew services start nginx 
Warning: Taking root:admin ownership of some nginx paths:
  /opt/homebrew/Cellar/nginx/1.25.2/bin
  /opt/homebrew/Cellar/nginx/1.25.2/bin/nginx
  /opt/homebrew/opt/nginx
  /opt/homebrew/opt/nginx/bin
  /opt/homebrew/var/homebrew/linked/nginx
This will require manual removal of these paths using `sudo rm` on
brew upgrade/reinstall/uninstall.
Warning: nginx must be run as non-root to start at user login!
Bootstrap failed: 5: Input/output error
Error: Failure while executing; `/bin/launchctl bootstrap system /Library/LaunchDaemons/homebrew.mxcl.nginx.plist` exited with 5.

- 阅读剩余部分 -

从某些角度讲,我是一个保守派。

就比如各种家用小电器,电动剃须刀、电动冲牙器,还有玩具之类的,我就非常不喜欢内置锂电池款的。

虽说内置电池可以省下买 5 号 7 号电池的钱,但真正使用的时候就就会发现这几个问题:

- 阅读剩余部分 -

今天为了本地编译一个开源软件,用 homebrew 安装了 rustc,结果后来发现导致 php 命令报错。

dyld[16856]: Library not loaded: /opt/homebrew/opt/libavif/lib/libavif.15.dylib
  Referenced from: <87C1A268-34E4-396F-8BBC-D5591064E333> /opt/homebrew/Cellar/gd/2.3.3_5/lib/libgd.3.dylib
  Reason: tried: '/opt/homebrew/opt/libavif/lib/libavif.15.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/libavif/lib/libavif.15.dylib' (no such file), '/opt/homebrew/opt/libavif/lib/libavif.15.dylib' (no such file), '/usr/local/lib/libavif.15.dylib' (no such file), '/usr/lib/libavif.15.dylib' (no such file, not in dyld cache), '/opt/homebrew/Cellar/libavif/1.0.1/lib/libavif.15.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/libavif/1.0.1/lib/libavif.15.dylib' (no such file), '/opt/homebrew/Cellar/libavif/1.0.1/lib/libavif.15.dylib' (no such file), '/usr/local/lib/libavif.15.dylib' (no such file), '/usr/lib/libavif.15.dylib' (no such file, not in dyld cache)
Abort trap: 6

- 阅读剩余部分 -