博客園自定義樣式主題 -- cnblogs theme

[TOC]css

博客園自定義樣式主題

不得不說,博客園自帶的主題的樣式都很通常,不過好在提供了自定義接口,因此就折騰一番吧。html

首先選擇基礎的主題(個人是red_autumnal_leaves),不然所有本身寫工做量仍是不小的。git

能夠經過F12查看主題自帶的基礎樣式,而後在此基礎上修改並保存下來。github

1. 子標題

子標題想定義成連接,so,點擊管理、設置、子標題 填寫以下內容:ide

<a href="https://github.com/b4zinga" target="_blank">https://github.com/b4zinga</a>post

如下【2 - 13】都是最終寫在 管理、設置、頁面定製css代碼 完整代碼詳見github https://github.com/b4zinga/PythonTools/blob/master/cnblogs%20theme.cssgoogle

2. 導航欄

/*******************博客導航欄 *********************/
#navList {
    float: left;
}

#navList li {
    border: none;
    font-size: 16px;
}

.blogStats {
    display: none;
}

3. 文章主體樣式

/************** 主體內容樣式 ***********************/
.postBody {
    padding: 20px 40px;
}

#cnblogs_post_body {
    font-size: 15px;
}

#cnblogs_post_body h2 {
    /*標題h2*/
    border-left: 5px solid #FF3300;
    padding: 10px 20px;
    line-height: 2;
    background: #d6dbdf8a;
    margin: 30px 0;
    font-size: 25px;
}

#cnblogs_post_body h3 {
    margin: 20px 0;
    padding: 10px 20px;
    border-left: 5px solid #FF3300;
    font-size: 20px;
}

#cnblogs_post_body h4{
    font-size: 18px;
    margin: 20px 0;
}

4. 引言樣式

/********************************引言樣式*****************************/
blockquote {
    border-left: 5px solid #FF3300;
}

blockquote strong {
    color: red;
    font-size: 18px;
}

5. 代碼不換行

pre {
    /*控制代碼不換行*/
    white-space: pre;
    word-wrap: normal;
}

6. 個性簽名

/******************* 個性簽名 ****************************/
#MySignature {
    box-shadow: 8px 1px 10px #989898;
    padding: 10px;
    text-shadow: 1px 1px 1px #FFF;
    font-size: 17px;
    border-left: solid 5px #FF3300;
    background: #F3F3F3;
    border-radius: 10px 10px 50% 10px;
    line-height: 2.4;
    margin: 40px 0;
}

#MySignature a {
    text-decoration: none;
    color: #4183c4;
    font-weight: bold;
}

#MySignature a:hover {
    text-decoration: underline;
    color: #f60;
}

#MySignature span {
    color: #f60;
}

7. 上一篇和下一篇

/********************** 上一篇下一篇 *************************/
#post_next_prev {
    font-size: 14px;
    color: #535353;
}

8. 評論

/************************評論********************************/
/*評論列表*/
#blog-comments-placeholder {
    border-radius: 10px;
    background: #fff;
    padding: 30px 40px;
}

.feedback_area_title {
    background: url(//www.cnblogs.com/skins/red_autumnal_leaves/images/titlebg.png) no-repeat left center #fff;
    border: 1px solid #FF3300;
    border-left-width: 5px;
    border-radius: 10px;
    border-right-width: 5px;
    padding: 15px 50px;
}

9. 提交按鈕

/******************** 提交評論按鈕 *******************************/
#btn_comment_submit {
    border: solid 1px #fd6d0dd1 !important;
    width: 90px;
    height: 40px;
    color: #fff !important;
    background-color: #fd6d0dd1 !important;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
}

10. 隱藏廣告和搜索框

/********************隱藏廣告******************************/
#ad_t2, #cnblogs_c1, #under_post_news, #cnblogs_c2, #under_post_kb {
    display: none;
}
/*******************隱藏搜索框*****************************/
#widget_my_google, #google_q{
    display: none;
}

11. 側邊欄公告

/*****************************側邊欄公告***********************/
#blog-news > img {
    /*頭像*/
    display: block;
    margin: auto;
    border-radius: 50%;
}

#profile_block {
    font-size: 15px;
    padding: 20px;
    line-height: 1.8;
}

#profile_block > a:link {
    color: #F60;
}
/*公告結束*/

12 . 側邊評論

/****************************側邊評論**********************************/
li.recent_comment_body {
    line-height: 30px;
}

13. 側邊欄樣式

/**********************sideBar博客側邊欄容器**********************************/
#sideBarMain h3, .newsItem h3 {
    font-size: 1.2em;
    height: 50px;
    line-height: 50px;
    text-indent: 0.5em;
    background: url(http://www.cnblogs.com/skins/red_autumnal_leaves/images/titlebg.png) no-repeat left center #fff;
    padding: 0 0 0 50px;
    margin-bottom: 0;
    border: 1px solid #FF3300;
    border-left-width: 5px;
    border-radius: 10px;
    border-right-width: 5px;
}
.newsItem, .catListComment, .catListEssay, .catListView, .catListFeedback,
#blog-calendar, #sidebar_postcategory, #sidebar_postcategory, #sidebar_postarchive, #sidebar_search {
    border-radius: 10px;
    box-shadow: 1px 2px 3px #A7A8AD;
    background-color: #fff;
}
#sideBarMain ul {
    background-color: #fff;
    padding: 15px 20px;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

#sideBarMain li {
    line-height: 40px;
    border-bottom: 1px solid #ddd;
    font-size: 14px;
}

以上【2 - 13】都是最終寫在 管理、設置、頁面定製css代碼 完整代碼詳見github https://github.com/b4zinga/PythonTools/blob/master/cnblogs%20theme.cssurl

14. 公告板頭像

管理、設置、博客側邊欄公告:spa

<img src="https://pic.cnblogs.com/avatar/1346826/20180320230642.png">code

15. 簽名

管理、博客簽名:

GitHub:<a href="https://github.com/b4zinga" target="_blank">https://github.com/b4zinga</a><br>
 博客園 : <a href="http://www.cnblogs.com/0x4D75/" target="_blank">http://www.cnblogs.com/0x4D75/</a>

配置中我的信息相關配置請酌情修改。

2. 最終結果

最終的結果也就是像本篇博客這個效果啦

本人對CSS能夠說是一竅不通的,本次配置主要是網上一通參考,再綜合我的屢次嘗試,通過一番增刪改查,最終完成本次配置,整體來是還算比較滿意。

3. Reference

2018 吳煜倫比的瘋丫頭 http://www.cnblogs.com/real-me/p/8336741.html

相關文章
相關標籤/搜索