蓝色 2 级标题
页面定制 CSS 代码
#cnblogs_post_body h2 {
background: none repeat scroll 0% 0% rgb(43, 102, 149);
border-radius: 6px 6px 6px 6px;
box-shadow: 0px 0px 0px 1px rgb(95, 90, 75), 1px 1px 6px 1px rgba(10, 10, 0, 0.5);
color: rgb(255, 255, 255);
font-family: "微软雅黑","宋体","黑体",Arial;
font-size: 17px;
font-weight: bold;
height: 25px;
line-height: 25px;
margin: 15px 0px !important;
padding: 5px 0px 5px 20px;
text-shadow: 2px 2px 3px rgb(34, 34, 34);
width: 98%;
}
#cnblogs_post_body h2 a{
color: rgb(235, 235, 235);
}
#cnblogs_post_body h2 a:hover{
color: rgb(255, 102, 0);
}
代码放缩
博客侧边栏 HTML
<script type="text/javascript">
$(document).ready(function () {
var pres = $("pre");
for (var i = 0; i < pres.length; i++) {
$(pres[i]).attr('id', 'pre' + i);
$(pres[i]).children('code').hide();
$(pres[i]).prepend('<button id="btn'+ i +'" οnclick="view_code(\'pre'+ i +'\');">view code</button>');
}
});
function view_code (id) {
var btn_text = document.getElementById(id).children[0].innerText;
var style;
var status;
if(btn_text == 'view code') {
style = '""';
status = 'hide code';
} else {
style = 'display: none;';
status = 'view code';
}
document.getElementById(id).children[0].innerText = status;
document.getElementById(id).children[1].style = style;
}
</script>