CSS练习之路----练习搭了一个超简易的页面

  • 一、以下是HTML的源码
<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>我的个人博客首页</title>
    <link rel="stylesheet" href="我的博客css代码.css">
</head>
<body>
<div class="blog-left">
    <div class="blog-avatar">
    	<!--这里可以修改成你自己的图片路径-->
        <img src=flower.jpg alt="" title="我的个人头像">
    </div>
    <div class="info">
        <p class="p1">
            我的个人博客
        </p>
        <p>
            从计算机小白<br>
            到计算机大佬的成神之路
        </p>
    </div>
    <div class="addr">
        <ul>
            <li>关注我</li>
            <li>
                <a href="https://weibo.com/u/5973083939/home?wvr=5" target="_blank">我的微博</a>
            </li>
            <li>
                <a href="https://blog.csdn.net/weixin_49114058" target="_blank">我的博客</a>
            </li>
            <li>
                <a href="">我的微信</a>
            </li>
        </ul>
    </div>
    <div class="msg">
        <p id="p1">技术栈</p>
        <p>Python</p>
        <p>Golang</p>
        <p>Java</p>
    </div>
</div>
<div class="blog-right">
    <div class="article">
        <div class="title">
            <p>
                烟雨江南&nbsp;&nbsp;最是迷人
            </p>
        </div>
        <div class="date">
            <p>
                2020-09-19 16:00
            </p>
        </div>
        <div class="content " >
            <p>风雨人生来时路,再回首,往事如烟,满腹惆怅谁人怜,看今朝,曲终人散</p>
            <hr>
        </div>
        <div class="where">
            <span>上海</span>
            <span>苏州</span>
        </div>

    </div>
    <div class="article">
        <div class="title">
            <p>
                烟雨江南&nbsp;&nbsp;最是迷人
            </p>
        </div>
        <div class="date">
            <p>
                2020-09-19 16:00
            </p>
        </div>
        <div class="content " >
            <p>风雨人生来时路,再回首,往事如烟,满腹惆怅谁人怜,看今朝,曲终人散</p>
            <hr>
        </div>
        <div class="where">
            <span>上海</span>
            <span>苏州</span>
        </div>

    </div>
    <div class="article">
        <div class="title">
            <p>
                烟雨江南&nbsp;&nbsp;最是迷人
            </p>
        </div>
        <div class="date">
            <p>
                2020-09-19 16:00
            </p>
        </div>
        <div class="content " >
            <p>风雨人生来时路,再回首,往事如烟,满腹惆怅谁人怜,看今朝,曲终人散</p>
            <hr>
        </div>
        <div class="where">
            <span>上海</span>
            <span>苏州</span>
        </div>

    </div>
    <div class="article">
        <div class="title">
            <p>
                烟雨江南&nbsp;&nbsp;最是迷人
            </p>
        </div>
        <div class="date">
            <p>
                2020-09-19 16:00
            </p>
        </div>
        <div class="content " >
            <p>风雨人生来时路,再回首,往事如烟,满腹惆怅谁人怜,看今朝,曲终人散</p>
            <hr>
        </div>
        <div class="where">
            <span>上海</span>
            <span>苏州</span>
        </div>

    </div>
    <div class="article">
        <div class="title">
            <p>
                烟雨江南&nbsp;&nbsp;最是迷人
            </p>
        </div>
        <div class="date">
            <p>
                2020-09-19 16:00
            </p>
        </div>
        <div class="content " >
            <p>风雨人生来时路,再回首,往事如烟,满腹惆怅谁人怜,看今朝,曲终人散</p>
            <hr>
        </div>
        <div class="where">
            <span>上海</span>
            <span>苏州</span>
        </div>

    </div>
    <div class="article">
        <div class="title">
            <p>
                烟雨江南&nbsp;&nbsp;最是迷人
            </p>
        </div>
        <div class="date">
            <p>
                2020-09-19 16:00
            </p>
        </div>
        <div class="content " >
            <p>风雨人生来时路,再回首,往事如烟,满腹惆怅谁人怜,看今朝,曲终人散</p>
            <hr>
        </div>
        <div class="where">
            <span>上海</span>
            <span>苏州</span>
        </div>

    </div>
    <div class="article">
        <div class="title">
            <p>
                烟雨江南&nbsp;&nbsp;最是迷人
            </p>
        </div>
        <div class="date">
            <p>
                2020-09-19 16:00
            </p>
        </div>
        <div class="content " >
            <p>风雨人生来时路,再回首,往事如烟,满腹惆怅谁人怜,看今朝,曲终人散</p>
            <hr>
        </div>
        <div class="where">
            <span>上海</span>
            <span>苏州</span>
        </div>

    </div>
</div>

</body>
</html>

二、以下是css的源码

* {
    margin: 0;
    padding: 0;
}

a {
    text-decoration: none;
    /*target: "_blank";*/
    /*target-name: new;*/
    /*target-new: tab;*/
}

a:link {
    color: yellow;
}

a:hover {
    color: whitesmoke;
}

a:visited {
    color: burlywood;
}

.clearfix {
    *zoom: 1;
}

.clearfix:before, .clearfix:after {
    content: '';
    display: table;
    clear: both;
}

body {
    background-color: rgba(0, 191, 255, 0.5);
    /*opacity: 0.5;*/
}

.blog-left {
    width: 25%;
    height: 100%;
    background-color: gray;
    position: fixed;
    float: left;
}

.blog-avatar {
    width: 180px;
    height: 180px;
    border: 5px solid white;
    margin: 50px auto;
    border-radius: 50%;
    overflow: hidden;

}

.blog-avatar > img {
    margin-top: -40px;
    max-width: 100%;
    /*height: 100%;*/
}

.info p {
    font-size: 30px;
    text-align: center;
    font-weight: bold;
    font-family: 方正姚体;
    color: yellow;
}

.info p:hover, .msg p:hover ,.addr ul > li:hover{
    color: white;
    font-size: 45px;
}

.p1 {
    margin-bottom: 20px;
}

.addr ul {
    margin-top: 50px;
    list-style: none;
}

.addr ul > li {
    font-size: 35px;
    font-family: 方正姚体;
    text-align: center;
    color: yellow;
    margin-top: 10px;
}



.msg {
    margin-top: 50px;
    text-align: center;
}

.msg p {
    font-size: 35px;
    font-family: 方正姚体;
    color: yellow;
    margin-top: 10px;
}

.blog-right {
    float: right;
    width: 75%;
    height: 1200px;
}

.article {
    width: 90%;
    height: 15%;
    background-color: whitesmoke;
    margin: 60px auto;
    box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.5);
    /*border-left: 10px solid red;*/
}

.title {
    border-left: 10px solid red;
    float: left;
    width: 50%;
    /*height: 40%;*/
}

.title p {
    margin: 10px 20px;
    font-size: 60px;
    font-family: 隶书;
    font-weight: bold;
    /*text-decoration: none;*/
}

.date {
    font-size: 20px;
    margin: 30px 5px;
    font-weight: bold;
    float: right;
    width: 20%;
    /*height: 10%;*/
}

.content {
    /*margin: 10px;*/
    width: 100%;
    /*height: 50px;*/
    float: left;
    /*background-color: yellow;*/
}
.content p {
    font-size: 30px;
    font-family: 隶书;
    margin: 10px 20px;
}
.where {
    height: 10%;
    float: left;
    margin-top: 5px;
}
.where span {
    font-size: 20px;
    margin-left: 30px;
    /*padding: 10px 20px;*/
    font-weight: bold;
}
  • 三、以下是效果图,没有最丑,只有更丑
  • 简易页面练习
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
HTML5/CSS 餐厅选择器 第一关 plate plate元素 第二关 bento bento元素 第三关 #fancy id为fancy的元素 第四关 plate apple plate祖先元素下的apple后代元素 第五关 #fancy pickle id为#fancy的祖先元素下的pickle后代元素 第六关 .small 组为small的元素 第七关 orange.small 组为small的orange元素 第八关 bento>orange.small bento父元素下的组为small的orange子元素 第九关 plate,bento,div plate,bento兄弟元素在div元素中 第十关 * *代表所有元素 第十一关 plate>* plate父元素的所有子元素 第十二关 plate + apple 兄弟元素选择器,plate元素的后一个元素 第十三关 bento~pickle 兄弟元素选择器,bento元素后的多个pickle元素 第十四关 plate>apple plate父元素下的apple子元素 第十五关 plate orange:first-child 子元素选择器,plate元素下的第一个orange元素 第十六关 plate :only-child 所有plate元素下的元素 第十七关 #fancy :last-child,pickle:last-child id为fancy的元素的最后一个和pickle元素的最后一个 第十八关 div plate:nth-child(3) div元素中的第三个plate元素 第十九关 div bento :nth-last-child(4) div元素中倒数第四个bento元素 第二十关 apple:first-of-type 第一个apple元素 第二十一关 plate:nth-of-type(even) 所有偶数个的plate元素 第二十二关 plate:only-of-type(6n+3),plate:only-of-type(6n+5) plate元素下的第3个和第5个元素 第二十三关 plate apple.small:only-of-type plate元素下满足apple.small元素的唯一一个元素 第二十四关 orange.small:last-of-type,apple.small:last-of-type 是orange.samll和apple.small元素的最后一个元素 第二十五关 bento:empty bento元素里没有包括额外元素 第二十六关 apple:not(.small) apple里没有组是.small的元素
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值