博客样式美化 一

Posted jerzy

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了博客样式美化 一相关的知识,希望对你有一定的参考价值。

先看效果

技术分享图片

技术分享图片

再看代码

选择博客园主题

选择极简风格的SimpleMenory主题

自定义样式

页面CSS

body {
    color: #000000b3;
    background: url(https://img2018.cnblogs.com/blog/1367440/201810/1367440-20181028163415543-591919591.jpg) fixed;
    background-size: 100%;
    background-repeat: repeat;
    font-family: "微软雅黑","Helvetica Neue",Helvetica,Verdana,Arial,sans-serif;
    font-size: 12px;
    min-height: 101%;
}
#blogTitle h1 {
    font-size: 50px;
    font-family: Consolas;
    font-weight: bold;
    font-style: italic;
    margin-top: 20px;
}
.catListTitle {
    background: none repeat scroll 0% 0% rgb(43, 102, 149);
    border-bottom: 1px solid #646b87e6;
    border-top-left-radius: 7px;
    border-top-right-radius: 7px;
    color: #FFFFFF;
    font-size: 1.2em;
    height: 1.3em;
    line-height: 1.3em;
    padding: 5px;
    text-indent: 0.5em;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.3);
}
#home {
    margin: 0 auto;
    width: 80%;
    min-width: 1250px;
    background-color: rgba(248, 248, 248, 0.85);
    padding: 30px;
    margin-top: 50px;
    margin-bottom: 50px;
    box-shadow: 0 2px 6px rgba(100, 100, 100, 0.3);
    position: relative;
}
.newsItem, .catListEssay, .catListLink, .catListNoteBook, .catListTag, .catListPostCategory, .catListPostArchive, .catListImageCategory, .catListArticleArchive, .catListView, .catListFeedback, .mySearch, .catListComment, .catListBlogRank, .catList, .catListArticleCategory {
    background: none;
    margin-bottom: 35px;
    word-wrap: break-word;
}
#blog-calendar td {
    font-size: 12px;
    font-family: Consolas;
}
.input_my_zzk {
    border: 1px solid #ccc;
    background: none;
    width: 100%;
    height: 25px;
    padding-right: 30px;
    padding-left: 5px;
    outline: 0;
}
.CalDayHeader {
    background: rgba(245,245,245,0.3) !important;
    font-weight: 100;
    color: #5E5F63;
}
.CalTitle {
    background: none;
    width: 100%;
    height: 25px;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    padding: 5px 0;
    color: #FFF;
}
.CalTitle td {
    background: rgba(245,245,245,0.3) !important;
    border: 0px !important;
    color: #5E5F63;
    font-family: "Comic Sans MS";
}
a:link {
    color: cornflowerblue;
}
a:visited {
    color: cornflowerblue;
}
a:hover {
    color:cadetblue;
}
a:active {
    color:black;
}
.CalTodayDay {
    background: rgba(247,247,247,0.3) !important;
    color: #D21414B3;
    font-weight: bold;
}
.cnblogs_code {
    background-color: rgba(247,247,247,0.3);
    font-family: Consolas !important;
    font-size: 12px!important;
    border: 1px solid #ccc;
    padding: 5px 10px;
    overflow: auto;
    margin: 5px 0;
    color: #000;
}
.cnblogs_code div {
    background-color: rgba(247,247,247,0.3);
}
.cnblogs_code_collapse {
    border-right: gray 1px solid;
    border-top: gray 1px solid;
    border-left: gray 1px solid;
    border-bottom: gray 1px solid;
    background-color: rgba(247,247,247,0.3);
    padding: 2px;
}
blockquote {
    background: rgba(197, 221, 48, 0.29);
    border:2px solid #efefef;
    padding-left: 10px;
    padding-right: 10px;
    padding-top: 5px;
    padding-bottom: 5px;
    margin-top: 10px;
    margin-bottom: 10px;
}
div.commentform input.author, div.commentform input.email, div.commentform input.url {
    background-image: url(http://static.cnblogs.com/images/icon_form.gif);
    border: 1px solid white !important;
    padding: 4px 4px 4px 30px;
    width: 300px;
    font-size: 13px;
    background-color: rgba(247,247,247,0.3);
}
#comment_form_container .comment_textarea {
    width: 362px;
    height: 200px;
    font-size: 13px;
    padding: 8px;
    margin-bottom: 10px;
    color: #555;
    border: 1px solid white;
    border-radius: 3px;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    background-color: rgba(247,247,247,0.3);
}
.cnblogs_code pre {
font-family: Consolas !important;
font-size: 12px!important;
word-wrap: break-word;
white-space: pre-wrap;
}
.cnblogs_code span {
font-family: Consolas !important;
font-size: 12px!important;
line-height: 1.5!important;
}
div#cnblogs_c2 {
display: none;
}
div#cnblogs_c1 {
display: none;
}
div#under_post_news {
display: none;
}
div#ad_t2 {
display: none;
}
div#under_post_kb {
display: none;
}
.feedbackItem {
    margin: 10px 5px 0px;
    padding: 5px;
    box-shadow: 0 0 10px 0 #AAA;
}
#topics .postTitle {
    font-size:300%;
    font-weight: normal;
}
.postTitle a:link, .postTitle a:visited, .postTitle a:active {
    color: #4b7c92;
    transition: all 0.4s cubic-bezier(0, 0, 0.12, 1) 0s;
}
#cnblogs_post_body h2 {
    padding: 10px 0px;
    margin: 20px 0px 0px;
    font-size: 20px;
    color: #263e54e6;
}
#cnblogs_post_body h3{
    padding: 2px 0px;
    color: #408392;
    font-size: 18px;
}
#cnblogs_post_body h4{
    color: #478dbacc;
    font-size: 16px;
}
#cnblogs_post_body h5{
 
    color: cadetblue;
}
#cnblogs_post_body h1{
    background: none repeat scroll 0% 0% rgb(43, 102, 149);
    border-radius: 6px 6px 6px 6px;
    box-shadow: 0px 0px 0px 1px rgb(95, 90, 75), 1px 1px 6px 1px rgba(10, 10, 0, 0.5);
    color: rgb(255, 255, 255);
    font-family: "微软雅黑","宋体","黑体",Arial;
    font-size: 20px;
    font-weight: bold;
    height: 20px;
    line-height: 20px;
    margin: 15px 0px !important;
    padding: 8px 0px 10px 20px;
    text-shadow: 2px 2px 3px rgb(34, 34, 34);
}
.buryit {
    
}

#div_digg {
    /* float: right;
    position: fixed;
    width: auto;
    bottom: 0px;
    left: 0.5%;
    margin-bottom: 10px;
    background: rgba(247,247,247,0.3);
    margin-right: 30px;
    font-size: 12px;
    box-shadow: 0 0 10px 0 #AAA;
    padding: 10px;
    border: 2px solid rgba(82, 168, 236, 0.8);
    text-align: center;
    margin-top: 10px; */
} 
textarea {
    background: rgba(247,247,247,0.3);
}


#navigatorTitleDiv
{
    padding: 3px;
    position: fixed;
    top:244px; 
    right:304px;
    font-weight:bold;
    cursor:pointer;
    background-color: antiquewhite;
}

#navigatorDiv 
{
    border-style:double;
    padding: 10px;
    padding-top:30px;
    position: fixed;
    top:240px; 
    right:300px;
    background-color: antiquewhite;
}

#cnblogs_post_body ul li
{
    color: #0009;
}
#cnblogs_post_body p
{
    color: #000000b3;
}

.hljs-comment
{
    font-size: 14px;
}   

.div_my_zzk
{
    width: 198px;
}

.postBody
{
    font-size: 16px;
    color: #3c0903b3;
}


.cnblogs-markdown code, .cnblogs-post-body code{
    font-size:14px !important;
    background-color:#ce9f9f4d !important;
    margin: 0px 0px 2px 0px;
}

.cnblogs-markdown .hljs, .cnblogs-post-body .hljs{
    color:#1b871be6;
}

.hljs-keyword, .hljs-selector-tag, .hljs-built_in, .hljs-name, .hljs-tag{
    margin:0px 2px 1px 2px;
    color: #0000ffe6;
}


.hljs-comment, .hljs-quote, .hljs-variable{
    color:#1b871be6;
}

.hljs-string, .hljs-title, .hljs-section, .hljs-attribute, .hljs-literal, .hljs-template-tag, .hljs-template-variable, .hljs-type, .hljs-addition{
    color: #b13535cc;
}


/*公告栏时钟样式*/
.clockdiv{
    text-align: center;
}

/* 重载SimpleMemory样式 调整公告栏位置*/
#mainContent{
    margin-left: -20em;
    float: right;
}
#sideBar{
    width: 235px;
}

/*
github.com style (c) 
*/
.cnblogs-markdown .hljs {
  background-color: #999fc61a !important;
  border: 1px solid #418a2f66 !important;     
  font-size:16px !important;
}

侧边公告栏html

<div class="clockdiv"><canvas id="clock" width ="200px" height="200px">您的浏览器不兼容canvas</canvas><div>
<script type="text/javascript" src="http://files.cnblogs.com/files/lixu880/canvas.js"></script>

页首HTML代码

<script type="text/javascript"> 
$(function(){
$("#home").prepend("<a href='https://github.com/JerzyLeung' target='blank' style='position: absolute; top: 0px; right:0px; border:0; z-index: 1;'><img src='http://images.cnblogs.com/cnblogs_com/stulzq/1239211/o_forkme_right_red_aa0000.png'></a>");
});
</script>

以上是关于博客样式美化 一的主要内容,如果未能解决你的问题,请参考以下文章

博客Valine评论样式美化

全网最全的博客美化系列教程06.推荐和反对炫酷样式的实现

博客样式美化 一

博客园美化夜间模式

美化博客园样式

博客园样式美化 II