WordPress教程:子比主题文章卡片和代码框仿MAC样式

WordPress教程:子比主题文章卡片和代码框仿MAC样式

前言

部分小伙伴总是喜欢给自己的网站添加得花里胡哨的,但是现在一些美化插件开始收费了,而且为了一个小的功能使用一整个插件确实不太值得,正好今天这个美化功能也只是简单添加代码就能实现的。本着能用代码实现坚决不使用插件的想法。

文章样式

直接在自定义css里添加以下代码,可以直接复制过去使用,具体样式可以看我网站。

/*文章列表左上角MAC美化 https://www.miwap.com/
.posts-item.card:last-child {
    margin-bottom: 8px !important;
}

.training-camp__wrapper .header__title-wrapper {
    font-size: 16px;
}

.sec-wrapper {
    margin-bottom: 10px;
}

.training-camp__wrapper .header__title-wrapper {
    color: #22ab80;
}

.training-camp__wrapper {
    background-image: linear-gradient(150deg, #cff0fb 20%, #cbf4e4 40%);
    padding: 0 12px 12px;
    border-radius: 16px;
}

button.button---AUM5ZP.text---pn4pHz.medium---OGt5iw.header__btn {
    background: #ffffff00;
    border: 1px solid #fc3c2d00;
    border-radius: 0px;
}

.training-camp__wrapper .training-camp__header {
    padding: 24px 0 24px 12px;
    display: -webkit-flex;
    display: flex;
    background: url(/pic/kuangwenlu.png) 100% 0/433px 126px no-repeat;
}

.training-camp__wrapper .header__title-wrapper {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
}

.training-camp__wrapper .title__img-wrapper {
    height: 20px;
}

.training-camp__wrapper .header__btn-wrapper {
    margin-left: auto;
    display: -webkit-flex;
    display: flex;
}

.training-camp__wrapper .header__btn-wrapper button[class*=button---] {
    height: 20px;
    line-height: 20px;
    padding: 0 12px;
}

.training-camp__wrapper .header__btn {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    font-size: 14px;
    color: #22ab80;
}

.medium---OGt5iw {
    height: 36px;
    padding: 8px 24px;
    font-size: 14px;
}

.outlined---BKvHAe,
.text---pn4pHz {
    background-color: initial;
    color: #3e454d;
}

.button---AUM5ZP {
    position: relative;
    display: inline-block;
    height: 36px;
    padding: 8px 24px;
    border-radius: 22px;
    cursor: pointer;
    border: unset;
    font-size: 14px;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

.ke-icon---zeGrGg+i {
    display: inline-block;
    vertical-align: middle;
}

.training-camp__wrapper>div.sec-bd {
    background-color: var(--body-bg-color);

}

.sec-wrapper .sec-bd {
    position: relative;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;

}

.training-camp__wrapper .sec-bd {
    padding: 12px;
    border-radius: 16px;
}

img.title-macyingyong {
    /* width: 120px; */
    height: 50px;
}

.posts-item.card {
    padding: 35px 10px 10px 10px !important;
}

.posts-item {
    position: relative !important;
}

.posts-item.card::before {
    content: "";
    display: block;
    background: #fc625d;
    top: 13px;
    left: 15px;
    border-radius: 50%;
    width: 9px;
    height: 9px;
    box-shadow: 16px 0 #fdbc40, 32px 0 #35cd4b;
    margin: 0px 2px -7px;
    z-index: 1;
    position: absolute;
}
/*列表左上角MAC边框美化 */

示例:

图片[1]-WordPress教程:子比主题文章卡片和代码框仿MAC样式-觅我坊

代码框美化

.enlighter::before {
    content: "";
    display: block;
    background: #fc625d;
    top: 9px;
    left: 15px;
    border-radius: 50%;
    width: 15px;
    height: 15px;
    box-shadow: 20px 0 #fdbc40, 40px 0 #35cd4b;
    margin: 0px 2px -7px;
    z-index: 1;
    position: absolute;
}
.enlighter-overflow-scroll.enlighter-v-standard .enlighter {
    padding: 35px 0 12px 0;
}

示例:

图片[2]-WordPress教程:子比主题文章卡片和代码框仿MAC样式-觅我坊

总结

还是一句话,能简单通过代码解决的,不使用插件。



微信扫描下方的二维码阅读本文

© 版权声明
THE END
喜欢就支持一下吧
点赞10 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片快捷回复

    暂无评论内容