前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >仿优设网首页分类页文章列表样式(修改父主题)

仿优设网首页分类页文章列表样式(修改父主题)

作者头像
小狐狸说事
发布2022-11-16 15:13:47
6340
发布2022-11-16 15:13:47
举报
文章被收录于专栏:小狐狸说事

效果图

加入子主题style.css

代码语言:javascript
复制
/*优设网文章样式开始*/
.col-3{
    flex: 0 0 auto; 
    width: 25% !important;
}  
.col-3 .widget-area{
    width: calc(100% - 16px);
    min-width: auto !important;
}
 
.col-3 .widget-title{
    font-size:23px;
    font-family: "webfont";
    border-bottom: 1px solid #eee;
    padding: 20px 0 20px 42px;
}
 
.col-3 .b2-widget-hot li.widget-post-none{
    height: 72px;
}
 
.col-3 .b2-widget-post-order span{
    font-size: 28px;
    height: 36px;
    line-height:36px;
}
 
.col-3 .widget ul li h2{
    font-size: 14px;
    line-height: 24px;
    margin-bottom: 0;
    -webkit-line-clamp:1;
}
 
.newstyle .item-in{
    padding:24px 18px 18px;
}
 
.newstyle .item-in .post-info h2{
    font-size: 19px;
    line-height:30px;
    margin:16px 0;
    font-weight: bold;
    color:#323232;
}
 
.newstyle .post-thumb{
    border-radius: 4px;
}
 
.newstyle .post-module-thumb a.thumb-link{
    overflow: hidden;
    display: block;
}
 
.newstyle .post-module-thumb img{
    -webkit-transition: all .3s;
    transition: all .3s;
}
.newstyle .item-in:hover .post-module-thumb img{
   transform: scale(1.2)  rotate(5deg);  
}
 
.newstyle .post-info .post-excerpt{
    margin:0 0 5px;
    background: #fafafa;
    padding: 12px 16px;
    font-size: 14px;
}
 
.newstyle  .post-info .post-excerpt p{ 
    -webkit-line-clamp: 2;
    overflow: hidden; 
    line-height: 25px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    word-break: break-all;
}
 
.newstyle .list-footer {
    border:none;
}
 
.newstyle .list-footer .post-list-meta-avatar img{
    width: 24px;
    height: 24px;
    margin-right: 8px;
}
 
.newstyle .list-footer span{
    overflow: visible;
    font-size: 14px;
}
 
.newstyle .post-list-meta-box{
    position:absolute;
    right: 18px;
    bottom: 21px;
}
 
.newstyle .post-list-meta-box a{
    font-size: 14px;
    color: #b5b5b5 !important;
    padding-left:24px;
}
 
.newstyle .post-list-meta-box a:hover,
.newstyle .list-footer a:hover{
    color:#0066ff !important;
}
.newstyle .post-list-meta-box a:before{
       content: '#';
    width: 18px;
    height: 18px;
    color: rgba(0, 102, 255,1);
    text-align: center;
    background: rgba(0, 102, 255,0.2);
    border-radius: 50%;
    display: block;
    position: absolute;
    left: 0;
}
 
@media screen and (max-width: 768px) {
    .newstyle .post-info .post-excerpt{
        margin-bottom: 18px;
    }
    .col-3,ul.b2_gap > li.newstyle{
        width: 100% !important;
    }
    .newstyle .post-list-meta-avatar img{
        display: block;
    }
    .newstyle .post-list-meta-box{
        bottom: 10px;
    }
}
/*优设网文章样式结束*/

首页新建模块

模板文件修改

b2/Modules/Templates/Modules/Posts.php

修改第140行,class加入newstyle

修改第151行,’.$v[‘des’].’前后各加上<p>和</p>

文章聚合小工具修改

b2/Modules/Templates/Index.php

102行前面加上col-3

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 效果图
  • 加入子主题style.css
  • 首页新建模块
  • 模板文件修改
  • 文章聚合小工具修改
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档