鹿泽笔记 - 记录互联网技术知识,工作与生活点滴的个人博客

typecho程序换个网页背景图的教程

HTML代码:

 <div id="mememe"></div>

CSS:

#mememe {
  background: url(你的图片地址);
  background-repeat: no-repeat;
  width: 100%;
  height: 100%;
  position: fixed;
  background-position: bottom right;
  bottom: 0;
  right: 0;
  z-index: -1
}

使用方法

  • 就是吧css加到style.css 文件里面,然后HTML代码加到你需要的页面,比如我加到了
  • index.php
  • page-archives.php
  • page.php
  • post.php
  • (在这些页面的need(‘footer.php’); ?>前即可)

第二个是大背景

<body class="custom-background">

CSS:

body.custom-background { 
  background-image: url('你的地址'); 
  background-repeat: no-repeat;
  background-position: top left; 
  background-attachment: fixed;
  background-size:cover
}

使用方法

css加到style.css里面去,然后再 header.php 的class加入custom-background的样式即可!

👋 感谢您的观看!

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享