Blog 页面实例


DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>blog页面实例title>
    <link rel="stylesheet" href="blog.css">
head>
<body>

<div class="left">
    
    <div class="header-img">
        <img src="touxiang.png" alt="">
    div>
    

    
    <div class="username">
        小强的狗窝
    div>
    
    
    
    <div class="jieshao">
        这条狗很懒,什么都没有留下
    div>
    
    
    <div class="blog-links">
        <ul>
            <li><a href="">关于我a>li>
            <li><a href="">关于你a>li>
            <li><a href="">关于他a>li>
        ul>
    div>
    
    
    <div class="blog-tags">
        <ul>
            <li><a href="">JSa>li>
            <li><a href="">CSa>li>
            <li><a href="">Pythona>li>
        ul>
    div>
    
div>



<div class="right">
    <div class="article-list">
    <div class="article">
        <div class="article-title">
            <h1 class="article-name">海燕h1>
            <span class="article-data">2018-10-23span>
        div>
        <div class="article-info">在苍茫的的大海上,狂风卷积着乌云,在乌云和大海之间,海燕像黑色的闪电,在高傲的飞翔。。div>
        <div class="article-tag"># Pythondiv>
    div>
div>
div>


body>
html>
/* Blog页面相关样式*/


/*公用样式*/

* {
    font-family: ".PingFang SC", "Microsoft YaHei";
    font-size: 14px;
    margin: 0;
    padding: 0;
}

/*去掉a标签的下划线*/
a {
    text-decoration: none;
}


/*左边栏 样式*/
.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 名称*/
.blog-name {
    color: white;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    margin-top: 15px;
}

/*Blog介绍*/
.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: "#";
}

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

.article-list {
    margin-left: 30px;
    margin-top: 30px;
    margin-right: 10%;
}
.article {
        background-color: 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;
}