看白色的背景时间长了难免会显得枯燥、今天想起来更改了背景图片、尝试了两种方法,看了网上的教程都是大同小异,在这里我就把我尝试过成功的记录下来。
方法一
修改主题配置文件style.css 插入如下代码
body { background-image: url(http://localhost/wordpress/wp-content/uploads/2018/01/timg.jpg); #图片路径放到主题下面 background-position: center center; background-size: cover; background-repeat: no-repeat; background-attachment: fixed; }
方法二
在主题下面新增按钮来更改背景图片,修改配置文件functions.php
新增以下内容
//添加背景按钮 add_theme_support( 'custom-background');
更换或者是调整网页 页尾 --- 页头改的方式也一样
颜色模式改为图像模式background-color: #fff;
background-image: url("./blog.sirliu.com.jpg");
.footer{ position: relative; z-index: 9; clear: both; padding: 40px 30px; font-size: 12px; line-height: 12px; text-align: center; color: #999; background-image: url("./sirliu.com-.jpg"); border-top: 1px solid #eaeaea; /*box-shadow: 1px 0 4px rgba(0,0,0,0.04)*/ }
最新评论
密码:blog.sirliu.com
本内容密码:blog.sirliu.com 最新整理的文章在这里喔:https://blog.sirliu.com/2018/11/shell_lian_xi_ti.html