碎碎念:html
makedown
來編寫博客,可是博客園自帶的編輯器真的不是很友好啊。。。。。還好,博客園比較人性化的有頁面樣式的自定製功能。爲了裝修個人博客,斷斷續續用了三、4天的時間(效率過低了),經過參考了一些博客以後,作了一下整理。git
小提示:
可能博客中的代碼與如今的樣式有點差別,那是由於以後有作過樣式的調整,具體代碼參考GitHub :https://github.com/RealAndMe/blogs-style
github
Makedown
來編寫,因此我選擇的編輯器是 Makedown
,在 [ 管理 ] - [ 選項 ]
中能夠設置。[ 管理 ] - [ 模版 ]
中有許多博客模板,能夠直接使用,界面也會變好看一點。我使用的是 red_autumnal_leaves (紅葉)
紅葉
的模版基礎上進行修改的,因此可能其餘的模版會出現兼容的問題,這個能夠根據本身的模版和喜愛進行修改。(我已經儘可能作到樣式兼容了,可是模版太多,愛莫能助啊。。。)能夠經過審查元素
的方法,來設置本身滿意的樣式。操做是F12
。
F12
操做能夠打開控制面板
,具體的樣式能夠直接在上面修改,而後把修改後的樣式保存下來。編輯器
保存後的樣式,複製到[ 管理 ] - [ 設置 ] - 頁面定製CSS代碼
上面,而後[ 保存 ]
ide
注意:
有時候修改的樣式沒有起做用,是由於樣式的優先級的緣由,這裏我選擇簡單粗暴的!important
來解決post
標題和子標題 是頁面最頂部的,設置在 [ 管理 ] - [ 設置 ] - 標題,子標題
字體
/* 博客標題和副標題 */ #blogTitle { overflow: hidden; height: auto; text-align: center; } #blogTitle h1 { font-size: 35px; width: 100%; margin-left: 0; } #blogTitle h2 { margin-left: 0; width: 100%; font-size: 20px; font-weight: bold; color: #000; }
/*博客導航欄 */ #navList { float: left; } #navList li { border: none; font-size: 16px; } .blogStats { display: none; }
/*sideBar博客側邊欄容器*/ #sideBar { width: 300px; box-sizing: border-box; margin-left: 30px; padding: 0; } .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 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 #55895B; border-left-width: 5px; border-radius: 10px; border-right-width: 5px; } /*側邊欄列表樣式*/ #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; }
在 [ 管理 ] - [ 設置 ] - 博客側邊欄公告
這裏添加 html
代碼,用來添加頭像,地址用本身的頭像flex
//圖片的地址更換成你的頭像的地址 <img src="https://cnblogspic.oss-cn-hangzhou.aliyuncs.com/avatar/937605/20180122200140.png">
/*側邊欄公告*/ #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; } /*公告結束*/
/* 日曆 */ #blog-calendar, #calendar { width: 300px; } #blog-calendar td { padding: 5px 3px; font-size: 14px; } #blog-calendar td a { font-weight: bold; color: #59a020; } #blog-calendar table a:hover { color: #59a020; text-decoration: underline; background: transparent; } #blog-calendar table u { text-decoration: none; } /*日曆結束*/
/*側邊搜索框*/ .mySearch { padding-bottom: 10px; } .mySearch > div { padding-top: 10px } .mySearch #q { height: 40px; width: 150px; border-radius: 5px; border: 1px solid #ddd; } .mySearch #btnZzk { height: 42px; width: 90px; background: #fd6d0dd1; color: #fff; border-radius: 5px; border: none; font-size: 15px; cursor: pointer; } .div_my_zzk { padding: 0 20px; display: flex; justify-content: space-around; } /*搜索框結束*/
碎碎念:url
由於我更新博客的頻率不多,並且質量還不是很高,因此評論也就不多。。。因此目前的評論列表樣式是這樣的,若是以後有更多的評論,那麼還會繼續修改樣式的,畢竟我是一個顏控啊!!
spa
/*評論*/ /*評論列表*/ #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 #55895B; border-left-width: 5px; border-radius: 10px; border-right-width: 5px; padding: 15px 50px; }
/* 提交評論按鈕 */ #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; }
/*側邊評論*/ li.recent_comment_body { line-height: 30px; }
個性簽名 這個是根據我的的喜愛設置的,能夠在 [ 管理 ] - [ 設置 ] - [ 博客簽名 ]
裏面自定義設置。下面展現個人個性簽名的設置。
/* 個性簽名 */ #MySignature { box-shadow: 8px 1px 10px #989898; padding: 10px; text-shadow: 1px 1px 1px #FFF; font-size: 17px; border-left: solid 5px #55895B; 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; }
/* 標題title樣式 */ #topics .postTitle { font-size: 25px; padding: 0 40px; border: none; box-sizing: border-box; } #cb_post_title_url { border: 1px solid #55895B; border-left-width: 5px; border-radius: 10px; border-right-width: 5px; background-position: left center; padding: 15px 50px; width: 100%; display: inline-block; box-sizing: border-box; }
/*設置背景色和字體大小*/ body { font-size: 15px; box-sizing: border-box; }
/*mainContent主體內容容器*/ #main { display: flex; width: 95%; } #mainContent .forFlow { margin: 0 0 0 310px; } #mainContent { margin: 0 0 0 -310px; } #post_detail { overflow: hidden; }
/* 主體內容樣式 */ .postBody { padding: 20px 40px; } #cnblogs_post_body { font-size: 15px; } #cnblogs_post_body h2 { //標題h2 border-left: 5px solid #55895B; padding: 10px 20px; line-height: 2; background: #d6dbdf8a; margin: 30px 0; } #topics .postDesc { display: none; }
/* 關注收藏等幾個按鈕 */ #green_channel { padding: 10px; margin: 20px 0; font-size: 15px; width: 400px; } #green_channel a { border-radius: 3px; text-shadow: none; font-weight: normal; box-shadow: none; }
/* 禁用下劃線 */ .postBody a:link, .postBody a:visited, .postBody a:active { text-decoration: none; } /* 上一篇下一篇 */ #post_next_prev { font-size: 14px; color: #535353; }
/*底部隱藏做者,隱藏推薦和反對*/ #author_profile { display: none; } #div_digg { display: none; } /*隱藏廣告*/ #ad_t2, #cnblogs_c1, #under_post_news, #cnblogs_c2, #under_post_kb { display: none; }