hexo背景图片及透明度修改

hexo添加背景图片及修改透明度

  首先将背景图片放入hexo\next\source\images文件夹下,之后修改hexo\themes\next\source\css\_custom\custom.styl文件,在程序中加入下面的代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*这里是加载背景图片,以及设置一些图片加载的问题*/
body{
/*url括号里的图片如果不是本地的,就直接写url*/
background: url(/images/background.jpg)
background-repeat: no-repeat;
background-attachment:fixed;
background-position:50% 50%;
background-size: cover;
-webkit-background-size: cover;
-o-background-size: cover;
-moz-background-size: cover;
-ms-background-size: cover;
}

/*这里的opacity参数是修改透明度的,值越小,透明度越大*/
.header-inner{
opacity: 0.8;
}
.main-inner {
// margin-top: 60px;
// padding: 60px 60px 60px 60px;

opacity: 0.8;
}