B2美化之首页圈子

B2自带的首页圈子说实话,有点丑。然后在网上找了找,发现NSTUN有个很好看的样式,就顺便美化了下,教程如下:

样式文件代码

/*开始布局*/

.home-section-knowledge {
    background: rgba(0,0,0,0);
}

@media (min-width: 768px) {
    .home-section-knowledge {
        background: rgba(0,0,0,0);
    }
}

.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 15px;
    position: relative;
    overflow: hidden;
    *zoom: 1;
}

@media (min-width: 768px) {
    .container {
        overflow: visible;
        max-width: 1330px;
    }
}

.part-hot-knowledge .part-title {
    font-size: 20px;
    color: #3c3c3c;
    margin: 0 -15px;
    font-weight: 400;
    background: rgba(0,0,0,0);
    padding: 15px;
}

@media (min-width: 768px) {
    .part-hot-knowledge .part-title {
font-size: 22px;
text-align: left;
margin-right: 10px;
font-weight: 600;
    }
}

/*第一部分*/

.part-hot-knowledge .part-content {
    margin: 0 0 30px;
}

@media (min-width: 768px) {
    .part-hot-knowledge .part-content {
        margin: 0;
    }
}

.articles_knowledge {
    margin: 0 -14px;
    overflow: hidden
}

.articles_knowledge .item_wrap {
    float: left;
    width: 100%;
    padding: 25px 14px 15px
}

@media (min-width:1024px) {
    .articles_knowledge .item_wrap {
        width: 50%;
        margin-bottom: 10px
    }
}

.articles_knowledge .item {
    background: #ffffff;
    padding: 0;
    -webkit-border-radius: 6px;
    border-radius: 6px;
    -webkit-transition: all .2s;
    -o-transition: all .2s;
    transition: all .2s;
    min-height: 150px
}

@media (min-width:768px) {
    .articles_knowledge .item {
        padding: 30px 40px
    }
}

.articles_knowledge .item:hover {
    -webkit-box-shadow: 0 0 10px rgba(0,0,0,.05);
    box-shadow: 0 0 10px rgba(0,0,0,.05);
    -webkit-transform: translateY(-3px);
    -ms-transform: translateY(-3px);
    transform: translateY(-3px)
}

.articles_knowledge .item-main {
    position: relative;
    padding-right: 126px
}

@media (min-width:768px) {
    .articles_knowledge .item-main {
        height: 210px;
        padding-right: 246px;
        margin-bottom: 30px
    }
}

.articles_knowledge .item-main .item-thumb {
    position: absolute;
    right: 0;
    top: -10px;
    width: 120px;
}

@media (min-width:768px) {
    .articles_knowledge .item-main .item-thumb {
        top: -50px;
        width: 200px
    }
}

.articles_knowledge .item-main .item-thumb .item-href {
    height: 280px;
    display: block;
    -webkit-border-radius: 6px;
    border-radius: 6px;
    position: relative;
    display: flex;
    align-items: center;
}

.articles_knowledge .item-main .item-thumb .thumb {
    padding-top: 130%;
    -webkit-border-radius: 6px;
    border-radius: 6px;
    -webkit-background-size: contain;
    background-size: contain
}

.articles_knowledge .item-main h2 {
    font-size: 16px;
    line-height: 3;
    height: 3em;
    overflow: hidden;
    margin-bottom: 3px;
    font-weight: 400;
    color: #2c3e50;
}

@media (min-width:768px) {
    .articles_knowledge .item-main h2 {
        font-size: 18px;
        margin-bottom: 20px
    }
}

.articles_knowledge .item-main h2 a {
    color: #2c3e50
}

.articles_knowledge .item-main h2 a:hover {
    color: #3385ff
}

.articles_knowledge .item-main ul li {
    display: block;
    padding: 5px;
    overflow: hidden;
    font-size: 12px
}

@media (min-width:768px) {
    .articles_knowledge .item-main ul li {
        padding: 10px;
        font-size: 14px
    }
}

.articles_knowledge .item-main ul li:nth-child(odd) {
    background: hsl(0deg 0% 82% / 16%)
}

.articles_knowledge .item-main ul li a {
    position: relative;
    display: block;
    height: 22px;
    line-height: 22px;
    overflow: hidden;
    color: #7c808a
}

.articles_knowledge .item-main ul li a:hover {
    color: #3385ff
}

.articles_knowledge h4 {
    font-size: 12px;
    line-height: 24px;
    font-weight: 400;
    color: #bdbdbd;
    overflow: hidden;
    height: 24px;
    display: none
}

@media (min-width:768px) {
    .articles_knowledge h4 {
        display: block
    }
}

.articles_knowledge h4 a {
    color: #bdbdbd
}

.articles_knowledge h4 a:hover {
    color: #3385ff
}

.articles_knowledge h4 span {
    float: left;
    margin-right: 40px
}

.articles_knowledge .avatar {
    width: 24px;
    height: 24px;
    -webkit-border-radius: 100%;
    border-radius: 5px;
    padding: 0;
    display: inline-block;
    vertical-align: top
}

.thumbs {
    display: block;
    width: 100%;
    height: 0;
    padding-top: 66.7%;
    background-position: 50%;
    background-repeat: no-repeat;
    -webkit-background-size: cover;
    background-size: cover;
    background-color: rgba(0,0,0,0);
    position: relative;
    overflow: hidden;
}

Module代码

给TA打赏
共{{data.count}}人
人已打赏
源码

wordpress主题域名授权源码

2022-7-12 21:49:28

源码

音效测试

2022-8-1 17:12:23

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
购物车
优惠劵
搜索