博客园样式排版自定义

css

作用到全局:

1 /*全局字符*/
2 html,body,div,span,em,dt,dd,li,a,textarea,input,select{
3     font:12px 'Segoe UI' , Tahoma, Geneva, Verdana !important;
4 }
5 /*首页菜单*/
6 #footer{display:none;}

作用到首页:

 1 /*首页菜单*/
 2 #nav_menu{height:23px;padding:5px 0 0 0;margin: 0px 7px 0 10px; position:absolute; width:100%;}
 3 /*隐藏首页顶部,尾部,左侧类别菜单*/
 4 #hd_info,#header,#footer_bottom,#cate_title_block{display:none;}
 5 /*首页左右侧顶部位置*/
 6 #side_right{top:46px;}
 7 #side_nav{display:none;}
 8 
 9 /* 博客列表容器 */
10 #main {margin: 10px 320px 0 10px !important;}
11 
12 .diggnum{line-height:32px !important;}
13 /*首页博客标题*/
14 #post_list h3 a:link,#post_list h3 a:visited,#post_list h3 a:active,#post_list h3 a:hover{
15      font-size:14px !important; font-weight:bold !important; 
16 }

作用到园子:http://home.cnblogs.com/ ,  http://q.cnblogs.com/

 1 /*园子顶部菜单*/
 2 #hd_top{height:23px;}
 3 #hd_top_w{margin-top:3px;}
 4 /*园子外容器*/
 5 #wrapper{width:1300px !important;}
 6 
 7 /*园子内容容器*/
 8 #container_content{width: 1130px!important;}
 9 #container_content #main{width:880px!important;}
10 #container_content #main .feed_body{width:820px!important;}
11 /*闪存发言容器*/
12 #ing_block{width:700px!important;}
13 
14 /*园子向上滚动*/
15 #goTop a img {width:50px; height:50px;}
16 /*闪存行距*/
17 #feed_list .ing_body, .ing_comments ul li{line-height:22px !important;}
18 
19 
20 
21 /*新闻标题*/
22 h2 a:link, h2 a:visited, h2 a:active,
23 #news_title a:link,#news_title:visited,#news_title a:active
24 {font-size:14px !important; font-weight:bold !important;}

JS代码

作用到首页:

 1 // ==UserScript==
 2 // @name       Jason Cnblogs--博客园美化
 3 // @namespace  http://www.cnblogs.com/jasonoiu/
 4 // @version    1.0
 5 // @description  博客园美化
 6 // @match      http://www.cnblogs.com
 7 // @require    http://common.cnblogs.com/script/jquery.js
 8 // @copyright  2013+, jasonoiu
 9 // ==/UserScript==
10 
11 
12 // a function that loads jQuery and calls a callback function when jQuery has finished loading
13 function addJQuery(callback) {
14   var script = document.createElement("script");
15   script.setAttribute("src", "//common.cnblogs.com/script/jquery.js");
16   script.addEventListener('load', function() {
17     var script = document.createElement("script");
18     script.textContent = "window.$=jQuery.noConflict(true);(" + callback.toString() + ")();";
19     document.body.appendChild(script);
20   }, false);
21   document.body.appendChild(script);
22 }
23 
24 // the guts of this userscript
25 function main() {
26     //园子向上滚动位置图片
27     var winWidth=$(window).width();
28     $("#goTop").css("left",(winWidth-1000)/2+1000+50+"px");
29     $("#goTop a img").attr("src","http://images.cnblogs.com/cnblogs_com/jasonoiu/331885/o_webtop.jpg");
30     
31     //show top pager
32     
33     
34     //取登录的值
35     function getLoginStr(){
36         var str= $("#span_userinfo").html();
37         if(str!=""){
38             str=str.replace('·','').replace('·','').replace('·','').replace('·','').replace('·','');
39             $("#nav_menu").append(str);
40             window.clearInterval(gl);
41         }
42     }
43     var gl=self.setInterval(function(){getLoginStr()},1000);
44     
45     
46 }
47 
48 // load jQuery and execute the main function
49 addJQuery(main);

未完待续。。。

原文地址:https://www.cnblogs.com/jasonoiu/p/blog_garden_style_custom_layout.html