前端知识之Blog示例

效果图:

blog.png

HTML代码:




    
    Blog页面示例
    


    
    
小强的狗窝
这只狗很懒,什么都没有留下

海燕

海燕

海燕

海燕

CSS文件代码:

/*Blog页面相关样式*/

/*公用样式*/

* {
    font-family: "Microsoft Yahei", "微软雅黑", "Arial", sans-serif;
    font-size: 14px;
    margin: 0;
    padding: 0;
}
/*去掉a标签的下划线*/
a {
    text-decoration: none;
}

/*左边栏样式*/
.div-left {
    width: 20%;
    background-color: rgb(76,77,76);
    height: 100%;
    position: fixed;
    left: 0;
    top: 0;
}
.header-img {
    height: 128px;
    width: 128px;
    border: 5px solid white;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto;
    margin-top: 20px;
}
.header-img>img {
    max-width: 100%;
}

.blog-name {
    color: white;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    margin-top: 15px;
}

/*bolg介绍*/
.blog-info {
    color: white;
    text-align: center;
    border: 2px solid white;
    margin: 5px 15px;
}

/*链接组和标签组*/
.blog-links,
.blog-tags {
    text-align: center;
    margin-top: 20px;
}

.blog-links a,
.blog-tags a {
    color: #eee;
}
.blog-tags a:before {
    content: "#";
}

/*右边栏样式*/
.div-right {
    width: 80%;
    background-color: rgb(238,237,237);
    height: 1000px;
    float: right;
}

.article-list {

    margin-right: 10%;
    margin-left: 30px;
    margin-top: 30px;
}

.article {
    background: white;
    margin-bottom: 15px;
}

.article-name {
    display: inline-block;

}

.article-title {
    padding: 15px;
    border-left: 3px solid red;
}

.article-info {
    padding: 15px;
}

.article-tag {
    padding: 15px 0;
    margin: 15px;
    border-top: 1px solid #eeeeee;
}
/*文章发布时间*/
.article-date {
    float: right;
}

你可能感兴趣的:(前端知识之Blog示例)