您的位置:首页 > Web前端 > CSS

博客园样式排版自定义

2013-11-13 17:54 267 查看

css

作用到全局:

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


作用到首页:

/*首页菜单*/
#nav_menu{height:23px;padding:5px 0 0 0;margin: 0px 7px 0 10px; position:absolute; width:100%;}
/*隐藏首页顶部,尾部,左侧类别菜单*/
#hd_info,#header,#footer_bottom,#cate_title_block{display:none;}
/*首页左右侧顶部位置*/
#side_right{top:46px;}
#side_nav{display:none;}

/* 博客列表容器 */
#main {margin: 10px 320px 0 10px !important;}

.diggnum{line-height:32px !important;}
/*首页博客标题*/
#post_list h3 a:link,#post_list h3 a:visited,#post_list h3 a:active,#post_list h3 a:hover{
font-size:14px !important; font-weight:bold !important;
}


作用到园子:http://home.cnblogs.com/ , http://q.cnblogs.com/
/*园子顶部菜单*/
#hd_top{height:23px;}
#hd_top_w{margin-top:3px;}
/*园子外容器*/
#wrapper{width:1300px !important;}

/*园子内容容器*/
#container_content{width: 1130px!important;}
#container_content #main{width:880px!important;}
#container_content #main .feed_body{width:820px!important;}
/*闪存发言容器*/
#ing_block{width:700px!important;}

/*园子向上滚动*/
#goTop a img {width:50px; height:50px;}
/*闪存行距*/
#feed_list .ing_body, .ing_comments ul li{line-height:22px !important;}

/*新闻标题*/
h2 a:link, h2 a:visited, h2 a:active,
#news_title a:link,#news_title:visited,#news_title a:active
{font-size:14px !important; font-weight:bold !important;}


JS代码

作用到首页:

// ==UserScript==
// @name       Jason Cnblogs--博客园美化
// @namespace  http://www.cnblogs.com/jasonoiu/ // @version    1.0
// @description  博客园美化
// @match      http://www.cnblogs.com // @require    http://common.cnblogs.com/script/jquery.js // @copyright  2013+, jasonoiu
// ==/UserScript==

// a function that loads jQuery and calls a callback function when jQuery has finished loading
function addJQuery(callback) {
var script = document.createElement("script");
script.setAttribute("src", "//common.cnblogs.com/script/jquery.js");
script.addEventListener('load', function() {
var script = document.createElement("script");
script.textContent = "window.$=jQuery.noConflict(true);(" + callback.toString() + ")();";
document.body.appendChild(script);
}, false);
document.body.appendChild(script);
}

// the guts of this userscript
function main() {
//园子向上滚动位置图片
var winWidth=$(window).width();
$("#goTop").css("left",(winWidth-1000)/2+1000+50+"px");
$("#goTop a img").attr("src","http://images.cnblogs.com/cnblogs_com/jasonoiu/331885/o_webtop.jpg");

//show top pager

//取登录的值
function getLoginStr(){
var str= $("#span_userinfo").html();
if(str!=""){
str=str.replace('·','').replace('·','').replace('·','').replace('·','').replace('·','');
$("#nav_menu").append(str);
window.clearInterval(gl);
}
}
var gl=self.setInterval(function(){getLoginStr()},1000);

}

// load jQuery and execute the main function
addJQuery(main);


未完待续。。。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: