目錄
- 1. 模板選擇
- 2. 自定義樣式
- 2.1 模塊介紹
- 2.2 頁面定制 CSS 代碼
- 2.3 頁首 HTML 代碼
1. 模板選擇
??注冊登錄博客園后,通過右上角頭像下的 我的博客 進入自己的博客主頁,找到 管理 進入后臺管理頁,選 設定 標簽,找到 “博客皮膚” 選擇喜歡的皮膚模板,
園主選的模板:LessIsMoreRight
選擇并使用模板后保存設定即可使用,如果對樣式布局不滿意,博客園提供了自定義樣式功能,可以進行樣式的自定義,
2. 自定義樣式
2.1 模塊介紹
還是進入設定模板的地方,設定項下面分幾塊可以通過自定義的HTML和CSS實作樣式的自定義化,共分為以下四個模塊:
- 頁面定制 CSS 代碼
- 博客側邊欄公告(支持HTML代碼) (支持 JS 代碼)
- 頁首 HTML 代碼
- 頁腳 HTML 代碼
通過這幾個模塊根據自己的喜好實作自定義化,
2.2 頁面定制 CSS 代碼
園主本人代碼如下:
.github-corner:hover .octo-arm {
animation: octocat-wave 560ms ease-in-out
}
@keyframes octocat-wave {
0%,
100% {
transform: rotate(0)
}
20%,
60% {
transform: rotate(-25deg)
}
40%,
80% {
transform: rotate(10deg)
}
}
@media (max-width:500px) {
.github-corner:hover .octo-arm {
animation: none
}
.github-corner .octo-arm {
animation: octocat-wave 560ms ease-in-out
}
}
#page_begin_html .back-to-top {
left: unset!important;
right: 304px!important;
height: 850px!important;
background: url(https://blog-static.cnblogs.com/files/fsh001/scroll.gif) 0px 850px;
}
#blogTitle .title {
font-size: 17pt;
text-align: center;
}
.CalTodayDay {
background-color: rgb(0,191,255)!important;
color: white!important;
}
.input_my_zzk {
width: 169px;
vertical-align: middle;
height: 20px;
}
#navigator #navList #nav_sitehome {margin-left: 35px;}
#navigator #navList #nav_myhome {margin-left: 75px;}
#navigator #navList #nav_newpost {margin-left: 22px;}
#navigator #navList #nav_contact {margin-left: 22px;}
#navigator #navList #nav_rss {margin-left: 22px;}
#navigator #navList #nav_admin {margin-left: 22px;}
.blogStats {margin-right: 66px;}
#blogTitle .subtitle {text-align: center;}
#blogTitle {padding: 5px;}
#p_b_follow a {color:red}
#post_detail {margin-left: 207px;}
#post_detail .postTitle {
text-align: center;
font-size: 14pt;
margin: 12px 0px 10px;
}
#ad_t2 {display: none;}
#opt_under_post {display: none;}
.under-post-card, #under_post_card1, #under_post_card2 {display: none;}
#post_detail .postBody .toc {
position: fixed;
width: 230px;
top: 156px;
left: 0px;
border-right: 1px solid #ccc;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
padding: 20px 4px 20px 6px;
}
#sideBar {
width: 236px;
padding: 0px 6px 20px 9px;
top: 156px;
}
.blogStats {margin-right: 14px;}
#page_begin_html .back-to-top {right: 217px !important;}
#mainContent {margin-right: 244px;}
.forFlow {margin: 0 33px 0 50px;}
#post_detail .postBody .toc .toc-container-header {font-weight: bolder;}
#post_detail .postBody .toc ul {margin-left: 22px;}
#post_detail .postBody .toc ul li a {text-decoration: none; }
.day .postTitle {font-size: 14pt;}
.comment_textarea {width: auto;}
div.commentform textarea {height: 200px;}
#commentbox_opt input[type="button"] {
color: white;
background-color: #06c;
}
#blogTitle .title #chenghao {
font-size: 8pt;
color: #999;
}
#blogTitle .title a:hover {color: #f00 !important;}
#blogTitle .subtitle a {color: #999;}
#blogTitle .subtitle a:hover {color: #f00;}
2.3 頁首 HTML 代碼
園主本人代碼如下:
<!-- github跳轉鏈接模塊 -->
<a href="https://github.com/lishen2020" target="_blank" >
<svg width="65" height="65" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; border: 0; right: 0; transform: scale(1, 1);" aria-hidden="true">
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
<path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" ></path>
<path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" ></path></svg>
<svg height="38" width="38" viewBox="0 0 16 16" version="1.1" style="position: fixed; top: 0.5px; border: 0; right: 0.5px; transform: scale(1, 1); z-index:999" aria-hidden="true" display="none">
<path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z" ></path></svg>
</a>
<!-- 懸掛的喵 -->
<script type="text/javascript" src="https://blog-static.cnblogs.com/files/fsh001/szgotop.js"></script>
<link rel="stylesheet" type="text/css" href="https://blog-static.cnblogs.com/files/fsh001/szgotop.css" />
<div style="top: -999px;"></div>
<script type="text/javascript">
$(function(){
$(".navbar-custom").css("display", "block");
navHeader();
$(window).scroll(function () {
navHeader();
changeColor();
})
function navHeader() {
if ($(window).scrollTop() > 100) {
$(".octicon1").css("display", "block");
$(".octicon").css("display", "none");
} else {
$(".octicon").css("display", "block");
$(".octicon1").css("display", "none");
}
}
// 改變懸浮塊貓頭的填充顏色
function changeColor() {
$(".octo-body1").css("fill", randomHexColor());
}
// 生成隨機色值
function randomHexColor() {
return '#' + ('00000' + (Math.random() * 0x1000000 << 0).toString(16)).substr(-6);
}
})
// 標題設定
var chenghao = "<a id='chenghao' href='https://baike.baidu.com/item/程顥/1453707' target='_blank'> 北宋 程顥(1032年~1085年)</a>";
$("#blogTitle .title").append(chenghao);
</script>
至此,園主本人通過
頁面定制 CSS 代碼和頁首 HTML 代碼兩個自定義模塊實作了目前的樣式,
如果你想要更舒服的樣式,可以通過對頁首、頁腳以及側邊欄的自定義化來具體實作,
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/277986.html
標籤:其他
