yuang01 / hexo-theme-bamboo

Hexo博客主题,功能强大,美观
https://hexo-theme-bamboo.netlify.app/
MIT License
414 stars 59 forks source link

如何设置页面宽度 #44

Open Nxhhhh opened 1 month ago

Nxhhhh commented 1 month ago

我想将文章页面的宽度加宽,并且调小字体,望指教。

yuang01 commented 1 month ago
  1. 首先在根目录下的source文件夹下创建一个文件夹custom/index.css,名字随便取
  2. custom/index.css里写入如下内容,css可自行新增或修改
    .post-detail-content {
    width: 88%; /* 宽度默认75%, */
    }
    .post-detail-content p { 
    font-size: 14px;
    }
    /* 其他元素字体大小,自己可以通过增加css来设置,这里只改了p文本元素的字体大小 */
  3. 找到主题下的themes\hexo-theme-bamboo\_config.yml配置文件,找到import这个配置,将自定义的css导入进去,写法如下
    # 自己嵌入css或者script
    import:
    link:
    - <link href="/custom/index.css" rel="stylesheet">

    就行了的