给hexo主题添加背景及更改字体颜色(next的Mist主题)

最近新搭的个人博客:qsang.xin
采用的是hexo + Github,next主题,自己动手更改了一下
在这里插入图片描述其实要更改某一部分,只需要F12找到元素然后找到相应元素就可以啦~

进入正题

更改背景

找到博客目录下\themes\next\source\css\_custom\custom.styl,加上以下代码:

 body {
    background-image:url(/images/background.png);
    background-repeat: no-repeat;
    background-attachment:fixed;
    background-position:50% 50%;
	background-size: 100% 100%;
    }

其中url里也可以换成图床地址,如果用Github作为图床,要将地址中的blob换成raw

还要注意background-size属性,可以根据自己需求设置图片比例

更换site-title及menu字体颜色

找到博客目录下theme\next\source\css\_common\components\header\site-meta.styl文件,在.brand{}里添加以下代码:

color: #ffb6c1 !important;

#ffb6c1为颜色rgb代码 颜色rgb查询
注意:此时只更改了subtitle的字体颜色,想要同时改上下的两条线的颜色还需要打开themes\next\source\css\_schemes\Mist_header.styl,更改i{}中background(或者是添加的代码…忘记了):

    background: #ffb6c1 !important;

找到博客目录下theme\next\source\css\_common\components\header\menu.styl文件,在a{}里面添加以下代码:

color: #ffb6c1 !important;
更改底部字体颜色

找到博客目录下theme\next\source\css\_custom\custom.styl,往里面添加以下代码:

.footer-inner {color: #ffb6c1;}
更改侧边栏中字体颜色

找到博客目录下\themes\next\source\css\_custom\custom.styl,加上以下代码:

#sidebar {
           p,span,a {color: #ffb6c1;}
}

当然,如果你想在侧边栏上换上其他图片作为背景,还可以在里面添加参数:

#sidebar {
            background:url(/images/background.png);
            background-size: cover;
            background-position:center;
            background-repeat:no-repeat;
            p,span,a {color: #ffb6c1;}
}

完成(~ ̄▽ ̄)~

评论 22
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值