html5+css3项目 (企业网站之集团活动)

只是单纯的跟着视频做一个记录,顺便回顾一下基础

界面



1.界面分析:

最上面是一个标题也就是 集团活动然后是一个列表  活动展示 下面左边是列表 右边也是列表

2.代码解析:

①第一标题 设置class 名字 和之前的一样 css也会设置这里的标题
     <div class="title_bg">
                <h2><a href="list.html">集团活动</a></h2>
            </div>
② 接下来是集团活动列表 
      <section id="huodong_a">
                <ul>
                    <li><a href="content.html"><img src="images/hd_1.jpg"> </a> </li><li>
                    <a href="content.html"><img src="images/hd2.jpg"> </a> </li><li>
                    <a href="content.html"><img src="images/hd3.jpg"> </a> </li><li>
                    <a href="content.html"><img src="images/hd2.jpg"> </a> </li>
                </ul>
            </section>
接下来就是设置成一行
css 代码:
/*集团活动展示图片列表CSS*/
section#huodong_a{
    /*设置间距*/
    margin-top: 10px;
}
section#huodong_a li{
    /*横向对其*/
    display: inline-block;
    vertical-align: top;
    margin-right: 9px;
}
section#huodong_a li:last-child{
    /*最后是没有间距的*/
    margin-right: 0;
}
section#huodong_a li img{
    /*即使图片变了布局也不会变*/
    width: 150px;
    height: 150px;
}

③集团新闻活动表示一个列表 同时还有滑动效果
html 代码:
  <section id="huodong_b">
                <ul>
                    <li><a href="content.html">新闻标题会很长很长很长新闻标题会很长很长很长新闻标题会很长很长很长新闻标题会很长很长很长</a></li>
                    <li><a href="content.html">新闻标题会很长很长很长新闻标题会很长很长很长新闻标题会很长很长很长新闻标题会很长很长很长</a></li>
                    <li><a href="content.html">新闻标题会很长很长很长新闻标题会很长很长很长新闻标题会很长很长很长新闻标题会很长很长很长</a></li>
                    <li><a href="content.html">新闻标题会很长很长很长新闻标题会很长很长很长新闻标题会很长很长很长新闻标题会很长很长很长</a></li>
                    <li><a href="content.html">新闻标题会很长很长很长新闻标题会很长很长很长新闻标题会很长很长很长新闻标题会很长很长很长</a></li>
                    <li><a href="content.html">新闻标题会很长很长很长新闻标题会很长很长很长新闻标题会很长很长很长新闻标题会很长很长很长</a></li>
                    <li><a href="content.html">新闻标题会很长很长很长新闻标题会很长很长很长新闻标题会很长很长很长新闻标题会很长很长很长</a></li>
                    <li><a href="content.html">新闻标题会很长很长很长新闻标题会很长很长很长新闻标题会很长很长很长新闻标题会很长很长很长</a></li>
                    <li><a href="content.html">新闻标题会很长很长很长新闻标题会很长很长很长新闻标题会很长很长很长新闻标题会很长很长很长</a></li>
                    <li><a href="content.html">新闻标题会很长很长很长新闻标题会很长很长很长新闻标题会很长很长很长新闻标题会很长很长很长</a></li>
                </ul>
            </section>

同时计算好宽高 列表去掉前面点 使用before 选择器自动加入计数器 进行 前三是蓝色后面全是黑色  同时列表100%宽度不换行,自动省  然后右边的因为要和上面的对其 使用间隔

section#huodong_b{
    width: 469px;
    display:inline-block;
    margin-top:10px;
    vertical-align: top;
    margin-right: 9px;
}
section#huodong_b li:before{
    content: counter(listxh);
    background: #444;
    padding: 2px 5px;
    color: #fff;
    margin-right: 5px;
}
section#huodong_b li{
    counter-increment: listxh;
    display: inline-block;
    width: 100%;
    vertical-align: bottom;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    margin-top: 16px;
    -webkit-transition:text-shadow 1s linear;
    -moz-transition:text-shadow 1s linear;
    -ms-transition:text-shadow 1s linear;
    -o-transition:text-shadow 1s linear;
    transition:text-shadow 1s linear;
}
section#huodong_b li:first-child:before,section#huodong_b li:nth-child(2):before,section#huodong_b li:nth-child(3):before{
    background: #3598DC;
}
section#huodong_b li:last-child:before{
    padding: 2px;
    font-size: 14px;
}
section#huodong_b a{
    color: #444444;
    text-decoration: none;
}
section#huodong_b li:hover{
    text-shadow: 1px 4px 4px #000;
}
section#huodong_c{
    width: 150px;
    display:inline-block;
}
section#huodong_c li{
    display:inline-block;
    vertical-align: top;
    margin-top:10px;
}
section#huodong_c li:first-child,section#huodong_c li:first-child img{
    width:150px;
    height:205px;
}
section#huodong_c li:last-child,section#huodong_c li:last-child img{
    width:150px;
    height:154px;
}

End

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值