品优购 主体模块

设计

主体模块-main,是index里面专有的,之一需要新的样式文件 index.css

主体部分

  • mian盒子宽度为980像素,位置距离左边220px,给高度就不用清除浮动
  • main里面包含左侧盒子,左浮动,focus焦点图模块
  • main里面包含右侧盒子,有浮动,newflash新闻快报模块
    示意图

mian盒子

主体盒子在版心之中,在建立main盒子,让其离左边有足够距离

<div class="w">
     <div class="main">
     </div>
 </div>
.main {
  position: relative;
  margin-left: 220px;
  margin-top: 10px;
  width: 980px;
  height: 455px;
}

focus 焦点图

  • 很多张图片,使用ul li,通过改变位置来实现轮播
  • 上下张按钮使用绝对定位
  • 轮播图选择按钮组通过ol li制作,点击的添加active
      <div class="focus fl">
        <a href="" class="prev"></a>
        <a href="" class="next"></a>
        <ul>
          <li>
            <img src="./upload/focus.jpg" alt="">
          </li>
        </ul>
        <ol class="focus_circle">
          <li></li>
          <li class="active"></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
        </ol>
      </div>
.focus .prev,
.focus .next {
  position: absolute;
  top: 50%;
  margin-top: -20px;
  color: #fff;
  width: 24px;
  height: 40px;
  text-align: center;
  line-height: 40px;
  font-size: 18px;
  font-family: icomoon;
  background-color: rgba(0, 0, 0, .3);
}
.focus .prev {
  left: 0;
}
.focus .next {
  right: 0;
}
.focus .prev:hover,
.focus .next:hover {
  color: #e33333;
}
.focus_circle {
  position: absolute;
  left: 50px;
  bottom: 10px;
}
.focus_circle li {
  float: left;
  margin: 0 3px;
  border: 2px solid rgba(255, 255, 255, .5);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  cursor: pointer;
  background-color: transparent;
}
.focus_circle li.active {
  background-color: #fff;
}

newsflash 新闻快报模块

快报.png
  • 1号盒子为news 新闻模块 高度为 165px
  • 2号盒子为lifeservice生活服务模块,高度为209px
  • 3号盒子为bargain特价商品模块
news
      <div class="news">
          <div class="news-hd">
            <h5 class="fl">品优购快报</h5>
            <a href="#" class="more fr">更多</a>
          </div>
          <div class="news-bd">
            <ul>
              <li><a href="#"><strong>【重磅】</strong>爆款耳机5折秒!爆款耳机5折秒!</a></li>
              <li><a href="#"><strong>【重磅】</strong>母亲节,健康好礼低至5折!</a></li>
              <li><a href="#"><strong>【重磅】</strong>爆款耳机5折秒!</a></li>
              <li><a href="#"><strong>【重磅】</strong>爆款耳机5折秒!</a></li>
              <li><a href="#"><strong>【重磅】</strong>爆款耳机5折秒!</a></li>
            </ul>
          </div>
        </div>
.news {
  height: 165px;
  border: 1px solid #e4e4e4;
}
.news-hd {
  padding: 0 15px;
  height: 33px;
  line-height: 33px;
  background-color: #fff;
  border-bottom: 1px dotted #e4e4e4;
}
.news-hd h5 {
  font-size: 14px;
}
.news-hd .more::after {
  font-family: icomoon;
  content: '\e905';
}
.news-bd {
  padding: 5px 15px 0;
}
.news-bd ul li {
  height: 24px;
  line-height: 24px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
lifeservice
      <div class="lifeservice">
          <ul>
            <li>
              <i></i>
              <p>话费</p>
            </li>
            <li>
              <i></i>
              <p>话费</p>
            </li>
            <li>
              <i></i>
              <p>话费</p>
            </li>
            <li>
              <i></i>
              <p>话费</p>
            </li>
            <li>
              <i></i>
              <p>话费</p>
            </li>
            <li>
              <i></i>
              <p>话费</p>
            </li>
            <li>
              <i></i>
              <p>话费</p>
            </li>
            <li>
              <i></i>
              <p>话费</p>
            </li>
            <li>
              <i></i>
              <p>话费</p>
            </li>
            <li>
              <i></i>
              <p>话费</p>
            </li>
            <li>
              <i></i>
              <p>话费</p>
            </li>
            <li>
              <i></i>
              <p>话费</p>
            </li>
          </ul>
        </div>
.lifeservice {
  overflow: hidden;
  height: 209px;
  /* background-color: skyblue; */
  border: 1px solid #e4e4e4;
  border-top: 0;
  /* border-bottom: 0; */
}
.lifeservice ul {
  width: 252px;
}
.lifeservice ul li {
  float: left;
  width: 63px;
  height: 71px;
  text-align: center;
  border-right: 1px solid #e4e4e4;
  border-bottom: 1px solid #e4e4e4;
}
.lifeservice ul li:hover {
  color: #b1191a;
}
.lifeservice ul li i {
  display: inline-block;
  margin: 12px 0 0 5px;
  width: 24px;
  height: 28px;
  background: url(../images/icons.png) no-repeat -19px -15px;
}
bargain
<div class="bargain">
    <img src="./upload/bargain.jpg" alt="">
</div>
.bargain {
  margin-top: 5px;
}
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容