Tùy chỉnh giao diện Blog Garden cá nhân (Phiên bản cơ bản)

Ảnh minh họa:

Giao diện blog

Các bước thực hiện:

Chọn giao diện nền: darkgreentrip

 

Mã CSS tùy chỉnh trang

#home {
    margin: 0 auto;
    width: 80%;
    min-width: 980px;
    background-color: rgba(245, 245, 245, 0.7);
    padding: 30px;
    margin-top: 50px;
    margin-bottom: 50px;
    box-shadow: 0 2px 6px rgba(100, 100, 100, 0.3);
}
body {
    background: #d2d8de;
    background-position: 50% 5%;
    background-size: cover;
    background-color: #f8f8f8;
}
#blogTitle {
    height: 100px;
    clear: both;
    background-color: rgba(245, 245, 245, 0);
}
#blogTitle h1 {
    font-size: 36px;
    font-weight: bold;
    line-height: 1.8em;
    margin-top: 10px;
    color: #548B54;
}
#blogTitle h2 {
    font-weight: normal;
    font-size: 17px;
    line-height: 1.8;
    color: #111;
    font-weight: bold;
    text-align: right;
    float: right;
}
#navigator {
    background-color: rgba(33, 160, 139, 0.9);
}
#navList a:link, #navList a:visited, #navList a:active {
    color: #eee;
    font-size: 18px;
    font-weight: bold;
}
.blogStats {
    color: #eee;
}
.postTitle {
    border-left: 8px solid rgba(33, 160, 139, 0.68);
    margin-left: 10px;
    margin-bottom: 10px;
    font-size: 20px;
    float: right;
    width: 100%;
    clear: both;
}
.postTitle a:link, .postTitle a:visited, .postTitle a:active {
    color: #21759b;
    transition: all 0.4s linear 0s;
}
.postTitle a:hover {
    margin-left: 30px;
    color: #0f3647;
    text-decoration: none;
}
.postCon {
    float: right;
    line-height: 1.5em;
    width: 100%;
    clear: both;
    padding: 10px 0;
}
.day .postTitle a {
    padding-left: 10px;
}
.day {
    background: rgba(255, 255, 255, 0.5);
}
.postDesc {
    background: url(images/posted_time.png) no-repeat 0 1px;
    color: #757575;
    float: left;
    width: 100%;
    clear: both;
    text-align: left;
    font-family: "微软雅黑", "宋体", "黑体", Arial;
    font-size: 13px;
    padding-right: 20px;
    margin-top: 20px;
    line-height: 1.8;
    padding-bottom: 35px;
}
.newsItem, .catListEssay, .catListLink, .catListNoteBook, .catListTag, .catListPostCategory,
.catListPostArchive, .catListImageCategory, .catListArticleArchive, .catListView,
.catListFeedback, .mySearch, .catListComment, .catListBlogRank, .catList, .catListArticleCategory, #blog-calendar {
    background: rgba(255, 255, 255, 0.5);
    margin-bottom: 35px;
    word-wrap: break-word;
}
.CalTitle {
    background: rgba(255, 255, 255, 0);
}
.catListTitle {
    background-color: rgba(33, 160, 139, 0.9);
}
#topics {
    background: rgba(255, 255, 255, 0.5);
}
.c_ad_block {
    display: none;
}
#tbCommentBody {
    width: 100%;
    height: 200px;
    background: rgba(255, 255, 255, 0.5);
}
#q {
    background: rgba(255, 255, 255, 0);
}
.CalNextPrev {
    background: rgba(255, 255, 255, 0);
}
.cnblogs_code {
    background: rgba(255, 255, 255, 0);
}
.cnblogs_code div {
    background: rgba(255, 255, 255, 0);
}
.cnblogs_code_toolbar {
    background: rgba(255, 255, 255, 0);
}
.entrylist {
    background: rgba(255, 255, 255, 0.5);
}
#main {
    min-width: 640px;
}

Thông báo thanh bên blog (hỗ trợ HTML và JavaScript)

<style>
#back-top {
    position: fixed;
    bottom: 10px;
    right: 5px;
    z-index: 99;
}
#back-top span {
    width: 50px;
    height: 64px;
    display: block;
    background: url(http://images.cnblogs.com/cnblogs_com/seanshao/855033/o_rocket.png) no-repeat center center;
}
#back-top a {
    outline: none;
}
</style>
<script type="text/javascript">
$(function() {
    $("#back-top").hide();
    $(window).scroll(function() {
        if ($(this).scrollTop() > 500) {
            $('#back-top').fadeIn();
        } else {
            $('#back-top').fadeOut();
        }
    });
    $('#back-top a').click(function() {
        $('body, html').animate({
            scrollTop: 0
        }, 800);
        return false;
    });
});
</script>
<p id="back-top" style="display: none;"><a href="#top"><span></span></a></p>
<img src="https://pic.cnblogs.com/avatar/2129350/20200818105600.png" alt="Ảnh đại diện" class="img_avatar" width="210px" height="210px" style="border-radius: 10%;">

Mã HTML đầu trang

<a href="https://github.com/liwei125">
    <img style="position: absolute; top: 0; right: 0; border: 0;"
        src="https://camo.githubusercontent.com/e7bbb0521b397edbd5fe43e7f760759336b5e05f/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677265656e5f3030373230302e706e67"
        alt="Fork me on GitHub">
</a>

Mã HTML chân trang (Hiệu ứng trái tim khi click chuột)

<script>
!function(e, t, a) {
    function n() {
        c(".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: fixed;}.heart:after{top: -5px;}.heart:before{left: -5px;}"),
        o(),
        r();
    }
    function r() {
        for (var e = 0; e < d.length; e++)
            d[e].alpha <= 0 ?
                (t.body.removeChild(d[e].el), d.splice(e, 1)) :
                (d[e].y--,
                d[e].scale += .004,
                d[e].alpha -= .013,
                d[e].el.style.cssText = "left:" + d[e].x + "px;top:" + d[e].y + "px;opacity:" + d[e].alpha + ";transform:scale(" + d[e].scale + "," + d[e].scale + ") rotate(45deg);background:" + d[e].color + ";z-index:99999");
        requestAnimationFrame(r);
    }
    function o() {
        var t = "function" == typeof e.onclick && e.onclick;
        e.onclick = function(e) {
            t && t();
            i(e);
        };
    }
    function i(e) {
        var a = t.createElement("div");
        a.className = "heart";
        d.push({
            el: a,
            x: e.clientX - 5,
            y: e.clientY - 5,
            scale: 1,
            alpha: 1,
            color: s()
        });
        t.body.appendChild(a);
    }
    function c(e) {
        var a = t.createElement("style");
        a.type = "text/css";
        try {
            a.appendChild(t.createTextNode(e));
        } catch (t) {
            a.styleSheet.cssText = e;
        }
        t.getElementsByTagName("head")[0].appendChild(a);
    }
    function s() {
        return "rgb(" + (255 * Math.random()) + "," + (~~(255 * Math.random())) + "," + (~~(255 * Math.random())) + ")";
    }
    var d = [];
    e.requestAnimationFrame = function() {
        return e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame || e.oRequestAnimationFrame || e.msRequestAnimationFrame || function(t) {
            e.setTimeout(t, 1000 / 60);
        };
    }();
    n();
}(window, document);
</script>

 

Thẻ: Blog Garden css JavaScript tùy chỉnh

Đăng vào ngày 31 tháng 5 lúc 06:06