### [B2主题 首页 动态4格 广告代码](https://ai.guaqi.com/article/51683) **Published:** 2021-06-20T05:43:10 **Author:** 纸工场 **Excerpt:** 先来一个效果 演示网站:https://paper.tv/ 在网站根目录建立一个文件夹,放入图片与 CSS(新建一个 ad.css,内容如下 ) .ad-Wrap { height: 90px; margin:0 auto; background-color: transparent; } .privilegesList-items,.privilegesList-items a,.privilegesList.ptabPics { display:block; } .tabIcons,.tabIcons-Img, 先来一个效果  演示网站:https://paper.tv/ 在网站根目录建立一个文件夹,放入图片与 CSS(新建一个 ad.css,内容如下 ) ``` .ad-Wrap { height: 90px; margin:0 auto; background-color: transparent; } .privilegesList-items,.privilegesList-items a,.privilegesList.ptabPics { display:block; } .tabIcons,.tabIcons-Img,.ptabPics { position:absolute; } .privilegesList-items a,.tabIconsWrap { position:relative; } .privilegesList { clear:both; height:auto; z-index:2; } .privilegesList a { width:100%; height:100%; } .privilegesList .privilegesList-items { width:245px; height:70px; } .privilegesList-items { /*框*/ float:left; margin:10px 10px 0 0; font-weight:700; } .privilegesList-items a { text-align:center; /* background:#eee; 框效果去底 border-radius:8px; border:1px solid #b2bac2; */ box-sizing:border-box; -ms-box-sizing:border-box; -o-box-sizing:border-box; transition:all .15s linear 0s; border-radius: 5px; } .privilegesList-items a:hover { /*底色渐变*/ /* border:1px solid transparent; */ background:#caa36d; background:linear-gradient(90deg,#e1c08e,#b0834a); } .privilegesList-items a:hover .ptabPics { /*小图上移高度*/ transform:translateY(-10px); } .privilegesList-items a:hover .tabIcons-Img { top:0; } .privilegesList-items a:hover .tabIcons-text { /*指向文字色*/ color:#3b3020; } .tabIcons { /*标题图*/ margin-left:12px; margin-top:10px; z-index:3; } .tabIconsWrap { width:120px; height:27px; overflow:hidden; } .tabIcons-text { color:#999; font-size:15px; display:block; margin-top:6px; text-decoration:none; /*没下划线*/ white-space:nowrap; /*不换行*/ transition:all .15s linear 0s; } .tabIcons-Img { width:120px; top:-26px; } /*小图+上浮*/ .ptabPics { max-width:150px; pointer-events:none; top:-46px; z-index:2; right:-36px; transition:transform .15s linear 0s; } ``` 然后在WP后台 > B2主题设置 > 模块管理 > 首页 > 添加新模块 > 调用内容 自定义 这里注意要选 PC版, 即是“仅桌面可见”,手机版还没调整的! 填入下面内容: ```
``` 其中的内容 按自己网站的需要 修改, 所用到的图片文件可以自己去我网站 Paper.tv 用F12下载! 下面是所有的图片与PSD文件 + 代码文件 **Categories:** B2主题教程 **Comments:** **老林:**  **纸工场:** 下载文件给删了, 有需要在群共享下载吧 **远走高飞11689:** **campoem:**  **胡兴:** ? **汝阳:**  **seorapheal:**  **李贰捌:**  **千面妖:**  **win10928:** ? ---