B2主题美化-代码模块美化

B2PRO主题

版本:3.4.2

美化后如图

图片[1]-B2主题美化-代码模块美化-岸边IBIAN

操作示例:

在主题CSS引入如下代码:

代码一:

/*
 * ------------------------------------------------------------------------------
 * 代码高亮
 * ------------------------------------------------------------------------------
*/
.entry-content pre {
    position: relative;
    border-radius: 6px;
    padding-top: 50px;
    box-shadow: 0px 8px 20px -10px #000;
    height: auto;
    color: #fff;
}
.entry-content pre:before {
    content: '';
    position: absolute;
    top: 0;
    left: 25px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    margin: 15px 25px;
    background: #fdbc40;
}
.entry-content pre:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #fc625d;
    margin: 15px 25px;
}
 .language-php:after {
    content: '';
    position: absolute;
    top: 0;
    left: 50px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    margin: 15px 25px;
    background: #35cd4b;
}
.entry-content pre ol li:first-child{
    padding-top: 10px;
    border-radius: 8px 8px 0 0;
}
.entry-content pre ol li:last-child{
    border-radius: 0 0 8px 8px;
    padding-bottom: 10px;
}
.entry-content pre ol li p{
    margin-bottom: 0;
}
.entry-content pre .copy {
    position: absolute;
    top: 0;
    right: 0;
    margin: 10px 20px;
    cursor: pointer;
    color: #fc625d;
}
.entry-content pre .pun{
    color: #fc625d;
}
.entry-content pre .copy .pun {
    color: #fc625d;
}
.pure-highlightjs {
    color: #fff;
}
.pure-highlightjs {
    background: #2f3640;
    border: 0 !important;
    width: 100%;
    padding: 1.5em;
    border-radius: 0;
    font-size: .8rem;
    padding-left: 24px;
    line-height: 1.4;
}
.entry-content pre{overflow:auto}
iframe{
    height: 500px;
    width: 96%;
}

代码二

/*代码高亮开始*/
.entry-content pre:before {
    content: '';
    position: absolute;
    top: 0;
    left: 25px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    margin: 15px 25px;
    background: #fdbc40;
}
ol.linenums:after {
    content: '';
    position: absolute;
    top: 0;
    left: 50px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    margin: 15px 25px;
    background: #35cd4b;
}
.entry-content pre:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #fc625d;
    margin: 15px 25px;
}
.entry-content pre {
    position: relative;
    border-radius: 6px;
    padding-top: 50px;
    box-shadow: 0px 8px 20px -10px #000;
}
.entry-content pre .copy {
    position: absolute;
    top: 0;
    right: 0;
    margin: 10px 20px;
    cursor: pointer;
    color: #99a2aa;
}
/*代码高亮结束*/

THE END
点赞0赞赏 分享
共3条
头像
提交
头像

昵称

取消
昵称表情
    • 头像斜杠青年线报网0