首先在博客園后台管理頁面的相冊上傳自己想要設置背景的圖片:
上傳完成之后點擊該圖片進去:
看到大圖再通過控制台獲取路徑
然后轉到設置:
加上如下代碼:
body{
background-image: url("此處黏貼你剛剛找到的圖片路徑");
background-position: initial;
background-size: cover;
background-repeat: no-repeat;
background-attachment: fixed;
background-origin: initial;
background-clip: initial;
height:100%;
width:100%;
}
最后效果: