當年才學前端時就想改本身blog的UI,然鵝當時沒看見那個「申請JS權限」,一直覺得blog不能隨意DIY樣式,只改了少量CSS。
如今從新看看設置管理選項,簡單修改了一下樣式(注意:修改樣式以前發郵件給"contact@cnblogs.com")。本身設置樣式仍是感覺到了很大的侷限性,收到了皮膚框架的限制,而且編輯調試CSS什麼的很困難,但願cnblog從此增長徹底DIY的選擇,提供blog API直接徹底從頭製做。
javascript
附上個人CSS(未禁用默認樣式,僅僅覆蓋):css
1 * { 2 box-sizing: border-box; 3 } 4 body{ 5 background: url(YOUR IMAGE'S URL) 50% 0% / cover no-repeat fixed; 6 position: static; 7 } 8 #home { 9 margin: 0 auto; 10 width: 100%; 11 display: flex; 12 flex-direction: column; 13 } 14 #header{ 15 width: 100%; 16 height: 60px; 17 position: fixed; 18 z-index: 999; 19 opacity: 0.9; 20 margin-left: 0; 21 background-color: #97765a4a; 22 } 23 #blogTitle { 24 top: 14px; 25 font-family: fantasy; 26 left: 10px; 27 font-size: 27px; 28 } 29 #Header2_HeaderTitle{ 30 font-size: 27px; 31 } 32 #blogTitle .headermaintitle:link, #blogTitle .headermaintitle:visited, #blogTitle .headermaintitle:hover, #blogTitle .headermaintitle:active { 33 font-size: 27px; 34 } 35 #navigator { 36 position: absolute; 37 width: auto; 38 right: 0; 39 top: 20px; 40 } 41 #navList { 42 margin-top: 15px; 43 } 44 #main { 45 width: 100%; 46 display: flex; 47 flex-direction: row-reverse; 48 flex-wrap: wrap; 49 } 50 #mainContent { 51 margin-top: 60px; 52 top: 0; 53 flex: 1; 54 left: 0; 55 opacity: 0.9; 56 background: #ffffffe3; 57 } 58 #sideBar { 59 margin-top: 60px; 60 float: left; 61 width: auto; 62 background: none; 63 word-break: break-all; 64 } 65 #sideBarMain { 66 background-color: #f7f7f738; 67 opacity: 0.7; 68 margin-top: 0; 69 } 70 .catListTag ul a,.catListLink ul a,.catListPostArchive ul a,.catListComment ul a,.catListView ul a,.catListFeedback ul a,.catListView ul a{ 71 margin-right: 5px; 72 color: #f5f5f5; 73 font-family: 幼圓; 74 } 75 #my_footer { 76 width: 100%; 77 height: auto; 78 margin-top: 5px; 79 position: relative; 80 background-color: #a27b5c; 81 color: #FFFFFF; 82 font-size: 12px; 83 text-align: center; 84 font-family: Arial, sans-serif; 85 } 86 87 #leftcontentcontainer { 88 background: #00000000; 89 } 90 .div_my_zzk input{ 91 border-radius: 5px; 92 border: none; 93 } 94 #my_footer a{ 95 color: #dddddd; 96 } 97 #footer { 98 display: none; 99 }
個人JS(JS扔哪都行,jQuery庫cnblog自帶了):前端
<script type="text/javascript"> /* 鼠標點擊特效 */ var a_idx = 0; jQuery(document).ready(function($) { $("body").click(function(e) { var a = new Array("富強","民主","文明","和諧","自由","平等","公正","法治","愛國","敬業","誠信","友善"); var $i = $("<span/>").text(a[a_idx]); a_idx = (a_idx + 1) % a.length; var x = e.pageX, y = e.pageY; $i.css({ "z-index": 999999999999999999999999999999999999999999999999999999999999999999999, "top": y - 20, "left": x, "position": "absolute", "font-weight": "bold", "color": "rgb("+(255*Math.random())+","+(255*Math.random())+","+(255*Math.random())+")" }); $("body").append($i); $i.animate({ "top": y - 180, "opacity": 0 }, 1500, function() { $i.remove(); }); }); }); </script>
效果預覽:java
PC端:
app
手機等小屏幕設備(響應式彷佛只能用cnblog皮膚模板自帶的,本身寫的響應式CSS不會實現效果,有點迷):
框架
使用的背景圖:dom
還設計過好幾個相似的,大概就是很容易改,你們放手去設計就行了,本篇只是你的參考,別和我同樣哎哎哎ide