【子比美化】给1500px以上网站的一些修改代码,主要修改文章列表和文章内图片高度。附加悬浮特效

20251003230812496-image-3

20251003230850437-image-4

20251003230934962-image-5

20251003231029860-image-6

具体可修改数值适应自己的网站,我都在后面做备注说明了!

直接扔自定义CSS里。

/*-------开始-修改贴内幻灯片高度及分类顶部图文模块--------*/
.graphic,
.page-cover {
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    --main-color: #fff;
    color: var(--main-color);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 10px var(--main-shadow, rgba(0, 0, 0, 0.1)); /* 添加默认值 */
    padding: 0;
    padding-bottom: 190px;/* 文章购买模块图片修改高度,还有图片封面的高度,建议用px,不要用百分比 */
    border-radius: var(--main-radius, 30px); /* 添加默认圆角 */
    background: var(--graphic-bg, transparent); /* 添加背景变量 */
    transition: all 0.3s ease; /* 添加过渡效果 */
}

/* 分类页面封面特殊样式 */
.page-cover {
    padding-bottom: calc(10% + 80px);/* 列表顶部图片修改高度 */
    background: linear-gradient(135deg, var(--cover-gradient-start, #667eea), var(--cover-gradient-end, #764ba2)); 
}

/* 文章主图hover美化 */
.graphic:hover,
.page-cover:hover {
    transform: translateY(-2px); /* 悬停上浮效果 */
    box-shadow: 0 5px 20px var(--main-shadow, rgba(0, 0, 0, 0.2));
}

/* 响应式设计 */
@media (max-width: 768px) {
    .graphic,
    .page-cover {
        padding-bottom: 30%; /* 移动端文章内顶部图片调整比例 */
        border-radius: var(--mobile-radius, 6px);
    }
    
    .page-cover {
        padding-bottom: calc(10% + 60px);/* 移动端文章列表顶部图片调整比例 */
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .graphic,
    .page-cover {
        --main-shadow: rgba(0, 0, 0, 0.4);
    }
}
/*-------结束-修改贴内幻灯片高度及分类顶部图文模块--------*/

额外附送20个字体;选一个扔自定义CSS里

/* 1. 阿里巴巴普惠体 */
@font-face {
  font-family: 'AlibabaPuHuiTi';
  src: url('https://fonts.gstatic.com/ea/alibabapuhuiti/v2/AlibabaPuHuiTi-2-55-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

/* 2. 思源黑体 */
@font-face {
  font-family: 'SourceHanSans';
  src: url('https://fonts.gstatic.com/ea/sourcehansans/v2/SourceHanSansCN-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

/* 3. 思源宋体 */
@font-face {
  font-family: 'SourceHanSerif';
  src: url('https://fonts.gstatic.com/ea/sourcehanserif/v1/SourceHanSerifCN-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

/* 4. 得意黑 */
@font-face {
  font-family: 'DeyiHei';
  src: url('https://cdn.jsdelivr.net/gh/wordshub/free-font/assets/DeyiHei.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

/* 5. 霞鹜文楷 */
@font-face {
  font-family: 'LXGWWenKai';
  src: url('https://cdn.jsdelivr.net/gh/lxgw/LxgwWenKai@main/fonts/LXGWWenKai-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

/* 6. 优设好身体 */
@font-face {
  font-family: 'YouSheBiaoTiHei';
  src: url('https://cdn.jsdelivr.net/gh/wordshub/free-font/assets/YouSheBiaoTiHei.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

/* 7. 站酷酷黑 */
@font-face {
  font-family: 'ZcoolKuoHei';
  src: url('https://cdn.jsdelivr.net/gh/wordshub/free-font/assets/ZcoolKuoHei.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

/* 8. 站酷文艺体 */
@font-face {
  font-family: 'ZcoolWenyi';
  src: url('https://cdn.jsdelivr.net/gh/wordshub/free-font/assets/ZcoolWenyi.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

/* 9. 站酷小薇体 */
@font-face {
  font-family: 'ZcoolXiaoWei';
  src: url('https://cdn.jsdelivr.net/gh/wordshub/free-font/assets/ZcoolXiaoWei.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

/* 10. 庞门正道标题体 */
@font-face {
  font-family: 'PangMenZhengDao';
  src: url('https://cdn.jsdelivr.net/gh/wordshub/free-font/assets/PangMenZhengDao.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

/* 11. 联盟起艺卢帅正锐黑体 */
@font-face {
  font-family: 'LuShuaiZhengRuiHei';
  src: url('https://cdn.jsdelivr.net/gh/wordshub/free-font/assets/LuShuaiZhengRuiHei.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

/* 12. 胡晓波男神体 */
@font-face {
  font-family: 'HuXiaoBoNanShen';
  src: url('https://cdn.jsdelivr.net/gh/wordshub/free-font/assets/HuXiaoBoNanShen.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

/* 13. 素材集市康康体 */
@font-face {
  font-family: 'SucaiJishiKangKang';
  src: url('https://cdn.jsdelivr.net/gh/wordshub/free-font/assets/SucaiJishiKangKang.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

/* 14. 素材集市酷方体 */
@font-face {
  font-family: 'SucaiJishiKuFang';
  src: url('https://cdn.jsdelivr.net/gh/wordshub/free-font/assets/SucaiJishiKuFang.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

/* 15. 手札体 */
@font-face {
  font-family: 'ShouZhaTi';
  src: url('https://cdn.jsdelivr.net/gh/wordshub/free-font/assets/ShouZhaTi.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

/* 16. 江城圆体 */
@font-face {
  font-family: 'JiangChengYuanTi';
  src: url('https://cdn.jsdelivr.net/gh/wordshub/free-font/assets/JiangChengYuanTi.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

/* 17. 江城律动黑 */
@font-face {
  font-family: 'JiangChengHei';
  src: url('https://cdn.jsdelivr.net/gh/wordshub/free-font/assets/JiangChengHei.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

/* 18. 锐字真言体 */
@font-face {
  font-family: 'RuiZiZhenYan';
  src: url('https://cdn.jsdelivr.net/gh/wordshub/free-font/assets/RuiZiZhenYan.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

/* 19. OPPO Sans */
@font-face {
  font-family: 'OPPOSans';
  src: url('https://cdn.jsdelivr.net/gh/wordshub/free-font/assets/OPPOSans.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

/* 20. 鸿蒙字体 */
@font-face {
  font-family: 'HarmonyOS';
  src: url('https://cdn.jsdelivr.net/gh/wordshub/free-font/assets/HarmonyOS_Sans.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

 

© 版权声明
THE END
文章不错?点个赞呗
点赞6
评论 抢沙发

请登录后发表评论

    暂无评论内容