BNDong / Cnblogs-Theme-SimpleMemory

🍭 Cnblogs theme _ Basic theme : SimpleMemory
https://bndong.github.io/Cnblogs-Theme-SimpleMemory/v2.1/dist/
MIT License
3.64k stars 1.52k forks source link

文章图片不居中了 #315

Closed Scholar-City closed 4 months ago

Scholar-City commented 2 years ago

为啥用了之后,文章图片不居中了

Scholar-City commented 2 years ago

用的 v2.1.0 css 跟 js

博客地址:https://www.cnblogs.com/miruier/p/15733624.html

Jayant-Tang commented 1 year ago

我研究了一晚上搞定了 CSS加一行:

a[data-fancybox="gallery"] {
  display: block; /* 设置为块级元素 */
  margin: 0 auto; /* 左右居中 */

  text-align: center; /* 使子元素(也就是图片)居中 */
}