博客園自定義主題樣式


記錄我在定制個人blog頁面效果時遇到的技巧及方法等。

基本流程

  1. 設定博客皮膚為BluSky
  2. 定制首頁代碼:引入外部CSS

頁頂博主名字及副標題

在首頁html內輸入以下代碼可添加博主名到頁面頂端,也可添加副標題:

<header class="main-header" id="site-head">
        <div id="top" class="vertical">
            <div id="site-head-content" class="inner row">
                <div class="col-md-9">
                    <div class="site-description">
                        <h2 class="blog-title">YourBlogName</h1>
                        <h3 class="blog-description">SubtitleContent</h2>
                    </div>
                </div>
            </div>
        </div>
</header>
  • YourBlogName:主標題,可寫博主名等
  • SubtitleContent:副標題,可寫座右銘、博客說明等

字體及背景圖

創建CSS編寫頁面字體的信息及背景圖;首先需要引入所創建的CSS,方法為通過link標簽引入,在首頁html輸入:

<link type="text/css" rel="stylesheet" href="https://blog-static.cnblogs.com/files/YourBolg/YourTheme.css"/>
  • YourBlog:個人創建博客園blog時的Blog地址名
  • YourTheme:上傳編寫好的.css文檔到博客-管理-文件內,以便上述代碼調用

關於.css文件的定制信息包括各類標題、字體樣式、背景圖片等信息,能力有限暫不細講,但若采用其他主題可有更便捷方法實現更換背景圖、修改字體等功能。

Fork me on Github 標簽

在首頁html內輸入以下代碼即可實現標簽:

<a href="https://github.com/YourGithub">  
<img style="position: fixed; top: 0; right: 0; border: 0; z-index:9999;" 
	src="https://github.blog/wp-content/uploads/2008/12/forkme_right_red_aa0000.png?resize=149%2C149" class="attachment-full size-full" 
	alt="Fork Me On GitHub" data-recalc-dims="1">
</a>
  • YourGithub:個人github的鏈接
  • src="...":github官網提供的標簽樣式,可自行查找

參考


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM