16.CSS项目实战

该博客详细介绍了两个CSS项目的实现过程,包括`style.css`和`index.html`的代码内容,以及运行后的实际效果展示。
摘要由CSDN通过智能技术生成

目录

1.代码

 2.运行效果


1.代码

style.css

* {
    margin: 0;
    padding: 0;
}

body {
    background-image: url("../images/bg.gif");
}

/*头部*/
.header {
    width: 100%;
    height: 70px;
    background-color: #1B1C1D;
    position: fixed;
}

.header > .nav {
    width: 85%;
    margin: 0 auto;
    height: 100%;
}

/*标题*/
.header > .nav > .title {
    height: 100%;
    line-height: 70px;
    float: left;
    width: 25%;
    color: #00B5AD;
    font-size: 30px;
    font-weight: bold;
}

/*标签*/
.header > .nav > .label {
    float: left;
    height: 100%;
    width: 45%;
}

.header > .nav > .label > ul {
    list-style-type: none;
    color: #ABABAC;
}

.header > .nav > .label > ul > li {
    float: left;
    height: 36px;
    line-height: 36px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    margin: 17px 15px 0 0;
    padding: 0 15px;
    border-radius: 10px;
}

.header > .nav > .label > ul > li:hover {
    background-color: #2D2E2F;
    color: #FFFFFF;
}

.header > .nav > .label > ul > .checked {
    background-color: #3D3E3F;
    color: #FFFFFF;
}

/*搜索*/
.header > .nav > .search {
    height: 100%;
    width: 30%;
    float: left;
    cursor: pointer;
    position: relative;
}

.header > .nav > .search input {
    height: 36px;
    width: 70%;
    border-radius: 4px;
    border-width: 0;
    padding-left: 10px;
    outline: none;
    position: absolute;
    right: 0;
    top: 14px;
}

.header > .nav > .search img {
    height: 24px;
    position: absolute;
    right: 7px;
    top: 20px;
}

/*中间*/
.main {
    width: 85%;
    margin: 0 auto;
    padding-top: 130px;
}

/*左边*/
.main > .left {
    width: 23%;
    float: left;
}

/*左边小窗口*/
.main > .left > .aside-box {
    width: 100%;
    background-color: #FFFFFF;
    margin-bottom: 10px;
}

.main > .left > .aside-box > .title {
    width: 100%;
    height: 38px;
    color: #3D3D3D;
    line-height: 38px;
    padding: 0 16px;
    font-weight: bold;
}

.main > .left > .aside-box > .hr {
    width: 100%;
    height: 1px;
    background-color: #DCDFE6;
}

.main > .left > .aside-box > .content {
    width: 100%;
    padding: 8px 16px 16px 16px;
}

/*最新文章*/
.main > .left > .aside-box > .content > ul {
    width: 100%;
    color: #333333;
    list-style: none;
    cursor: pointer;
}

.main > .left > .aside-box > .content > ul > li {
    margin-top: 8px;
}

.main > .left > .aside-box > .content > ul > li:hover {
    color: #CF3016;
}

/*分类专栏*/
.main > .left > .aside-box > .class-content {
    padding-bottom: 16px;
    padding-top: 8px;
}

.main > .left > .aside-box > .class-content > .class {
    height: 20px;
    line-height: 20px;
    width: 100%;
    margin-top: 8px;
    cursor: pointer;
}

.main > .left > .aside-box > .class-content > .class > .name {
    float: left;
    padding: 0 16px;
    color: #333333;
}

.main > .left > .aside-box > .class-content > .class > .name:hover {
    float: left;
    padding: 0 16px;
    color: #CF3016;
}

.main > .left > .aside-box > .class-content > .class > .number {
    float: right;
    padding: 0 16px;
    font-size: 12px;
    color: #858585;
    height: 20px;
    line-height: 20px;
}

/*热门文章*/
.main > .left > .aside-box > .content > ul > li > .hot {
    height: 20px;
    line-height: 20px;
    color: #333333;
}

.main > .left > .aside-box > .content > ul > li > .hot:hover {
    color: #CF3016;
}

.main > .left > .aside-box > .content > ul > li > .red-number {
    height: 12px;
    line-height: 12px;
    font-size: 12px;
    color: #858585;
    margin-top: 3px;
}

/*联系博主*/
.main > .left > .aside-box > .img-content > img {
    width: 90%;
    margin: 16px 5%;
}

/*右边*/
.main > .right {
    width: 76%;
    float: right;
    background-color: #FFFFFF;
}

/*筛选排序*/
.main > .right > .filter-soft-box {
    width: 100%;
    height: 47px;
    border-bottom: 1px solid #000000;
    font-size: 16px;
}

/*筛选*/
.main > .right > .filter-soft-box > .filter {
    height: 100%;
    line-height: 47px;
    width: 30%;
    float: left;
    margin-left: 24px;
}

.main > .right > .filter-soft-box > .filter:hover {
    color: #CF3016;
}

.main > .right > .filter-soft-box > .filter input {
    height: 18px;
    width: 18px;
    cursor: pointer;
    vertical-align: middle;
}

.main > .right > .filter-soft-box > .filter label {
    cursor: pointer;
}

/*排序*/
.main > .right > .filter-soft-box > .soft {
    height: 100%;
    line-height: 47px;
    width: 60%;
    float: right;
}

.main > .right > .filter-soft-box > .soft > span {
    float: right;
    margin-right: 36px;
}

.main > .right > .filter-soft-box > .soft > .soft:hover {
    color: #CF3016;
    cursor: pointer;
}

.main > .right > .filter-soft-box > .soft > .name {
    color: #858585;
}

.color-red {
    color: #CF3016;
}

/*文章*/
.main > .right > .article {
    width: 100%;
    height: 112px;
    cursor: pointer;
    border-bottom: 1px solid #000000;
    padding-top: 10px;
}

.main > .right > .article:hover {
    background-color: #F5F5F5;
}

/*标题*/
.main > .right > .article > .title {
    padding: 0 20px;
    font-size: 18px;
    font-weight: bold;
    color: #3D3D3D;
}

.main > .right > .article > .title:hover {
    color: #CF3016;
}

/*内容*/
.main > .right > .article > .content {
    height: 39px;
    overflow: hidden;
    font-size: 14px;
    color: #6B6B6B;
    margin-top: 8px;
    padding: 0 20px;
}

/*文章底部*/
.main > .right > .article > .bottom {
    padding: 0 20px;
    margin-top: 8px;
    font-size: 13px;
    color: #6B6B6B;
}

.main > .right > .article > .bottom .num {
    color: #3399EA;
    margin-left: 3px;
}

.main > .right > .article > .bottom .point {
    margin: 0 8px;
}

/*分页*/
.main > .right > .page {
    width: 100%;
    height: 70px;
    position: relative;
}

.main > .right > .page > ul {
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值