web APIs-练习三

全选反选案例:






  
  
  



  
全选 商品 商家 价格
小米手机 小米 ¥1999
小米净水器 小米 ¥4999
小米电视 小米 ¥5999

仿新浪固定头部:





    
    
    
    Document
    



    
我是顶部导航栏
秒杀模块

m-bilibili:

index.css:

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
body {
  font-family: Helvetica Neue, Tahoma, Arial, PingFangSC-Regular, Hiragino Sans GB, Microsoft Yahei, sans-serif;
}
a {
  color: #333;
  text-decoration: none;
}
img {
  vertical-align: middle;
  width: 100%;
  height: 100%;
}
ul {
  list-style: none;
}
.ellipsis-2 {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.suspension {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 999;
  background-color: #fff;
  box-shadow: 0 0.53333vw 2.66667vw rgba(0, 0, 0, 0.2);
}
.suspension .m-navbar {
  padding: 0 3.2vw 0 4.8vw;
  height: 11.73333333vw;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.suspension .m-navbar .logo i {
  font-size: 7.46666667vw;
  color: #fb7299;
}
.suspension .m-navbar .right {
  display: flex;
}
.suspension .m-navbar .right .search {
  color: #ccc;
}
.suspension .m-navbar .right .search i {
  font-size: 5.86666667vw;
}
.suspension .m-navbar .right .face {
  overflow: hidden;
  width: 6.4vw;
  height: 6.4vw;
  border-radius: 50%;
  margin: 0 5.33333333vw;
}
.suspension .m-navbar .right .app-btn {
  width: 19.2vw;
  height: 6.4vw;
}
.suspension .channel-menu {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 10.66666667vw;
  border-bottom: 1px solid #e7e7e7;
}
.suspension .channel-menu .tabs {
  overflow: hidden;
  flex: 1;
}
.suspension .channel-menu .tabs .tabs-list {
  display: flex;
}
.suspension .channel-menu .tabs .tabs-list a {
  padding: 0 4.26666667vw;
  white-space: nowrap;
  font-size: 3.73333333vw;
  height: 10.66666667vw;
  line-height: 10.66666667vw;
}
.suspension .channel-menu .tabs .tabs-list .line {
  position: absolute;
  left: 4.26666667vw;
  bottom: 0;
  width: 7.46666667vw;
  height: 0.53333333vw;
  background-color: #fb7299;
  transition: all 0.3s;
}
.suspension .channel-menu .after {
  width: 10.66666667vw;
  height: 10.4vw;
  text-align: center;
  line-height: 10.4vw;
  background-color: #fff;
  color: #ccc;
}
.suspension .channel-menu .after i {
  font-size: 5.33333333vw;
}
.m-home {
  padding: 22.66666667vw 1.33333333vw 0;
}
.m-home .video-list {
  display: flex;
  flex-wrap: wrap;
}
.m-home .video-list .video-item {
  width: 50%;
  padding: 2.13333333vw 1.33333333vw;
}
.m-home .video-list .video-item .card {
  position: relative;
  height: 25.86666667vw;
}
.m-home .video-list .video-item .card .count {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 7.2vw;
  padding: 0 1.33333333vw;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 3.2vw;
  color: #fff;
  background-image: linear-gradient(transparent, red);
}
.m-home .video-list .video-item .title {
  margin-top: 1.33333333vw;
  font-size: 3.2vw;
}
.app {
  position: fixed;
  left: 0;
  bottom: 8vw;
  width: 100%;
  height: 10.13333333vw;
}
.app .btn-app {
  margin: 0 5.33333333vw;
  height: 10.13333333vw;
  background-color: purple;
  border-radius: 5.06666667vw;
  text-align: center;
  line-height: 10.13333333vw;
  background-color: #fb7299;
  color: #fff;
  box-shadow: 0 0.53333vw 2.66667vw rgba(0, 0, 0, 0.2);
}

index.html:





  
  
  
  bilibili-干杯~~~
  
  
  
  
  
  



  
  
播放量 评论数

315晚会能不能曝光下智能电视?N重广告、套娃会员、操作反人类,当代年轻人是怎么被智能电视逼疯的?【商业B面&牛顿】

播放量 评论数

315晚会能不能曝光下智能电视?N重广告、套娃会员、操作反人类,当代年轻人是怎么被智能电视逼疯的?【商业B面&牛顿】

播放量 评论数

315晚会能不能曝光下智能电视?N重广告、套娃会员、操作反人类,当代年轻人是怎么被智能电视逼疯的?【商业B面&牛顿】

播放量 评论数

315晚会能不能曝光下电视?

播放量 评论数

315晚会能不能曝光下智能电视?N重广告、套娃会员、操作反人类,当代年轻人是怎么被智能电视逼疯的?【商业B面&牛顿】

播放量 评论数

315晚会能不能曝光下智能电视?N重广告、套娃会员、操作反人类,当代年轻人是怎么被智能电视逼疯的?【商业B面&牛顿】

播放量 评论数

315晚会能不能曝光下智能电视?N重广告、套娃会员、操作反人类,当代年轻人是怎么被智能电视逼疯的?【商业B面&牛顿】

播放量 评论数

315晚会能不能曝光下智能电视?N重广告、套娃会员、操作反人类,当代年轻人是怎么被智能电视逼疯的?【商业B面&牛顿】

播放量 评论数

315晚会能不能曝光下智能电视?N重广告、套娃会员、操作反人类,当代年轻人是怎么被智能电视逼疯的?【商业B面&牛顿】

播放量 评论数

315晚会能不能曝光下智能电视?N重广告、套娃会员、操作反人类,当代年轻人是怎么被智能电视逼疯的?【商业B面&牛顿】

播放量 评论数

315晚会能不能曝光下智能电视?N重广告、套娃会员、操作反人类,当代年轻人是怎么被智能电视逼疯的?【商业B面&牛顿】

打开App,看你感兴趣的视频

电梯导航素材:

index.css:

@charset "UTF-8";

/* 页面滑动 */
html {
  /* 让滚动条丝滑的滚动 */
  scroll-behavior: smooth;
}

/** 分类及焦点图 **/
.xtx_entry {
  height: 500px;
  background-color: #f2f2f2;
  position: relative;
}

.xtx_category {
  width: 250px;
  background-color: rgba(0, 0, 0, 0.8);
  position: absolute;
  z-index: 9;
}

.xtx_category:hover .xtx_category_subset {
  display: block;
}

.xtx_category_super li {
  height: 50px;
  padding: 0 20px 0 40px;
  transition: background-color 0.25s;
  cursor: pointer;
}

.xtx_category_super li:hover,
.xtx_category_super li.active {
  background-color: #27BA9B;
}

.xtx_category_super a {
  color: #fff;
  font-size: 16px;
  line-height: 50px;
}

.xtx_category_super a small {
  font-size: 14px;
}

.xtx_category_super i {
  display: block;
  width: 12px;
  height: 12px;
  margin-top: 20px;
  background-position: -75px -110px;
  float: right;
}

.xtx_category_subset {
  width: 990px;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  display: none;
  position: absolute;
  top: 0;
  left: 250px;
}

.xtx_banner {
  width: 1240px;
  height: 500px;
  overflow: hidden;
  position: relative;
}

.xtx_banner:hover a {
  opacity: 1;
}

.xtx_banner>a {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  margin-top: -22px;
  opacity: 0;
  transition: opacity 0.5s;
  background-color: rgba(0, 0, 0, 0.1);
  position: absolute;
  top: 50%;
}

.xtx_banner>a.prev {
  left: 270px;
  background-position: 14px -59px;
}

.xtx_banner>a.next {
  right: 20px;
  background-position: -24px -59px;
}

.xtx_banner .indicator {
  width: 990px;
  text-align: center;
  font-size: 0;
  position: absolute;
  left: 250px;
  bottom: 22px;
}

.xtx_banner .indicator span {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin: 0 8px;
  cursor: pointer;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.43);
}

.xtx_banner .indicator span.active {
  background-color: #fff;
}

/** 公共面板 **/
.xtx_panel .xtx_panel_header {
  height: 115px;
  padding: 40px 0;
}

.xtx_panel .xtx_panel_header h3 {
  height: 35px;
  line-height: 35px;
  margin-left: 6px;
  font-size: 32px;
  font-weight: 400;
  color: #333;
  float: left;
}

.xtx_panel .xtx_panel_header small {
  margin-left: 22px;
  font-size: 16px;
  color: #999;
}

.xtx_panel .xtx_panel_header .more {
  line-height: 1;
  margin-top: 14px;
  font-size: 16px;
  color: #999;
  float: right;
}

.xtx_panel .xtx_panel_header .more i {
  display: inline-block;
  width: 16px;
  height: 16px;
  position: relative;
  top: 1px;
  background-position: 8px -106px;
}

.xtx_panel .xtx_panel_header .tabs-bar {
  height: 35px;
  padding-top: 13px;
  font-size: 16px;
  margin-right: 80px;
  float: right;
}

.xtx_panel .xtx_panel_header .tabs-bar a {
  padding: 2px 8px;
  margin-left: 5px;
  border-radius: 2px;
}

.xtx_panel .xtx_panel_header .tabs-bar a:hover,
.xtx_panel .xtx_panel_header .tabs-bar a.active {
  background-color: #27BA9B;
  color: #fff;
}

.xtx_panel .xtx_panel_goods_1 {
  text-align: justify;
  font-size: 0;
}

.xtx_panel .xtx_panel_goods_1:after {
  content: "";
  display: inline-block;
  width: 306px;
  height: 0;
}

.xtx_panel .xtx_panel_goods_1 a {
  display: inline-block;
  width: 306px;
  height: 406px;
  text-align: center;
}

.xtx_panel .xtx_panel_goods_1 img {
  width: 306px;
  height: 306px;
}

.xtx_panel .xtx_panel_goods_2 {
  height: 610px;
}

.xtx_panel .xtx_panel_goods_2 li {
  width: 240px;
  height: 300px;
  padding-top: 10px;
  margin-left: 10px;
  background-color: #fff;
  border: 1px solid #fff;
  overflow: hidden;
  transition: 0.3s;
  position: relative;
  float: left;
}

.xtx_panel .xtx_panel_goods_2 li:hover {
  border-color: #27BA9B;
}

.xtx_panel .xtx_panel_goods_2 li:hover .extra {
  bottom: 0;
}

.xtx_panel .xtx_panel_goods_2 li:first-child {
  height: 610px;
  padding-top: 0;
  margin-left: 0;
  border: 0;
}

.xtx_panel .xtx_panel_goods_2 li:nth-last-child(-n + 4) {
  margin-top: 10px;
}

.xtx_panel .xtx_panel_goods_2 a {
  display: block;
}

.xtx_panel .xtx_panel_goods_2 .img-box {
  width: 240px;
  height: 160px;
  padding: 0 33px;
  text-align: center;
  margin: 0 auto;
  display: table-cell;
  vertical-align: middle;
}

.xtx_panel .xtx_panel_goods_2 .meta {
  height: 130px;
  line-height: 1.3;
  padding: 10px 22px 0;
  font-size: 19px;
  position: relative;
}

.xtx_panel .xtx_panel_goods_2 .name {
  word-break: break-all;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.xtx_panel .xtx_panel_goods_2 .price {
  font-size: 22px;
  color: #CF4444;
  position: absolute;
  bottom: 10px;
}

.xtx_panel .xtx_panel_goods_2 .price small {
  font-size: 17px;
}

.xtx_panel .xtx_panel_goods_2 .extra {
  width: 100%;
  height: 86px;
  padding-top: 10px;
  transition: bottom 0.3s;
  background-color: #27BA9B;
  position: absolute;
  bottom: -86px;
}

.xtx_panel .xtx_panel_goods_2 .extra span {
  display: block;
  width: 124px;
  line-height: 1;
  padding: 9px 0 8px;
  margin: 0 auto;
  text-align: center;
  font-size: 19px;
  color: #fff;
}

.xtx_panel .xtx_panel_goods_2 .extra span:last-child {
  font-size: 13px;
  border-top: 1px solid #fff;
}

.xtx_panel .xtx_panel_goods_2 .label {
  position: absolute;
  left: 0;
  bottom: 266px;
  width: 188px;
  height: 66px;
  text-align: center;
  line-height: 66px;
  color: #fff;
  font-size: 17px;
  border-radius: 0 2px 2px 0;
  background-color: rgba(0, 0, 0, 0.8);
  position: relative;
}

.xtx_panel .xtx_panel_goods_2 .label span:first-child {
  display: block;
  width: 76px;
  background-color: #000;
}

.xtx_panel .xtx_panel_goods_2 .label span:last-child {
  width: 112px;
  line-height: 1.4;
  transform: translate(0, -50%);
  position: absolute;
  left: 76px;
  right: 0;
  top: 50%;
}

/** 新鲜好物 **/
.xtx_goods_new .xtx_panel_goods_1 a {
  background-color: #f0f9f4;
  transition: 0.5s;
  position: relative;
  top: 0;
}

.xtx_goods_new .xtx_panel_goods_1 a:hover {
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
  top: -3px;
}

.xtx_goods_new .xtx_panel_goods_1 .name {
  display: inline-block;
  width: 100%;
  margin: 12px 0 10px;
  font-size: 22px;
}

.xtx_goods_new .xtx_panel_goods_1 .price {
  font-size: 23px;
  color: #CF4444;
}

.xtx_goods_new .xtx_panel_goods_1 small {
  font-size: 16px;
}

/** 人气推荐 **/
.xtx_goods_popular {
  padding-bottom: 42px;
}

.xtx_goods_popular .xtx_panel_goods_1 a {
  transition: 0.5s;
}

.xtx_goods_popular .xtx_panel_goods_1 a:hover {
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
  transform: translate(0, -3px);
}

.xtx_goods_popular .xtx_panel_goods_1 .title {
  display: inline-block;
  width: 100%;
  line-height: 1;
  margin: 20px 0 16px;
  font-size: 22px;
}

.xtx_goods_popular .xtx_panel_goods_1 .alt {
  font-size: 18px;
  color: #999;
}

/** 热门品牌 **/
.xtx_goods_brand {
  padding-bottom: 32px;
  background-color: #f5f5f5;
}

.xtx_goods_brand .page-bar {
  float: right;
}

.xtx_goods_brand .page-bar a {
  display: inline-block;
  width: 20px;
  height: 20px;
  line-height: 1;
  margin-top: 10px;
  background-color: #e2e2e2;
}

.xtx_goods_brand .page-bar a:hover,
.xtx_goods_brand .page-bar a.active {
  background-color: #27BA9B;
}

.xtx_goods_brand .page-bar .prev {
  margin-right: 5px;
  background-position: -32px -106px;
  transform: rotate(180deg);
}

.xtx_goods_brand .page-bar .next {
  background-position: -32px -106px;
}

.xtx_goods_brand .xtx_goods {
  height: 305px;
}

.xtx_goods_brand .xtx_goods li {
  float: left;
  font-size: 0;
}

.xtx_goods_brand .xtx_goods a {
  margin-right: 10px;
}

.xtx_goods_brand .xtx_goods a img {
  width: 240px;
  height: 305px;
}

.xtx_goods_brand .xtx_goods a:last-child {
  margin-right: 0;
}

/** 生鲜 **/
.xtx_goods_category {
  padding-bottom: 80px;
}

/** 最新主题 **/
.xtx_goods_topic {
  background-color: #f5f5f5;
  padding-bottom: 52px;
}

.xtx_goods_topic li {
  width: 406px;
  margin-left: 11px;
  transition: 0.5s;
  float: left;
  background: white;
}

.xtx_goods_topic li:hover {
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
  transform: translate(0, -3px);
}

.xtx_goods_topic li:first-child {
  margin-left: 0;
}

.xtx_goods_topic li a {
  display: block;
  height: 287px;
  position: relative;
}

.xtx_goods_topic .meta {
  width: 100%;
  height: 100%;
  color: #fff;
  background-image: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent 50%);
  position: absolute;
  bottom: 0;
}

.xtx_goods_topic .meta .title {
  height: 70px;
  padding-left: 16px;
  font-size: 22px;
  position: absolute;
  bottom: 0px;
}

.xtx_goods_topic .meta .title small {
  display: block;
  font-size: 19px;
  color: #999;
}

.xtx_goods_topic .meta .price {
  position: absolute;
  bottom: 25px;
  right: 16px;
  display: block;
  line-height: 1;
  padding: 4px 8px 4px 7px;
  color: #CF4444;
  font-size: 17px;
  background-color: #fff;
  border-radius: 2px;
}

.xtx_goods_topic .meta .price small {
  font-size: 15px;
}

.xtx_goods_topic .social {
  height: 70px;
  line-height: 70px;
  padding: 0 20px;
  font-size: 16px;
}

.xtx_goods_topic .social i {
  display: inline-block;
  width: 15px;
  height: 14px;
  margin-right: 5px;
  position: relative;
  top: 2px;
}

.xtx_goods_topic .social .like,
.xtx_goods_topic .social .liked,
.xtx_goods_topic .social .view {
  float: left;
  margin-right: 25px;
}

.xtx_goods_topic .social .reply {
  float: right;
}

.xtx_goods_topic .social .like i {
  background-position: -120px -110px;
}

.xtx_goods_topic .social .liked i {
  background-position: -240px -110px;
}

.xtx_goods_topic .social .view i {
  background-position: -160px -110px;
}

.xtx_goods_topic .social .reply i {
  width: 17px;
  height: 16px;
  top: 4px;
  background-position: -200px -110px;
}

.xtx-wrapper {
  background: #f5f5f5;
  line-height: 1.4;
}

.xtx-wrapper .container {
  width: 1240px;
  margin: 0 auto;
}

.xtx-wrapper .container .title {
  height: 215px;
  line-height: 215px;
  font-size: 32px;
  text-align: center;
  font-weight: normal;
}

.xtx-bg-title {
  width: 100%;
  height: 180px;
  padding-left: 213px;
  background: no-repeat center / cover;
}

.xtx-bg-title h4 {
  padding-top: 52px;
  font-size: 32px;
  font-weight: bold;
}

.xtx-bg-title p {
  padding-top: 5px;
  font-size: 20px;
}

.xtx-large-product {
  margin-top: 40px;
  display: flex;
  justify-content: space-between;
}

.xtx-large-product .item {
  width: 610px;
  height: 420px;
  background: white;
  position: relative;
}

.xtx-large-product .item img {
  width: 100%;
  height: 320px;
  display: block;
}

.xtx-large-product .item p {
  padding-left: 55px;
}

.xtx-large-product .item p.tit {
  padding-top: 22px;
  font-size: 16px;
}

.xtx-large-product .item p.desc {
  padding-top: 12px;
  color: #999;
  font-size: 14px;
}

.xtx-large-product .item .price {
  position: absolute;
  bottom: 37px;
  right: 33px;
  color: #CF4444;
  font-size: 18px;
}

.xtx-large-product .item .tag {
  width: 170px;
  height: 40px;
  border: 1px solid #fff;
  border-radius: 4px;
  position: absolute;
  top: 17px;
  left: 15px;
  line-height: 40px;
  color: #fff;
  text-align: center;
  font-size: 16px;
}

.xtx-mini-product {
  padding-top: 40px;
  padding-bottom: 20px;
}

.xtx-mini-product ul li {
  width: 232px;
  height: 320px;
  float: left;
  background: white;
  margin-right: 20px;
  text-align: center;
  margin-bottom: 20px;
}

.xtx-mini-product ul li:nth-child(5n) {
  margin-right: 0;
}

.xtx-mini-product ul li img {
  width: 160px;
  height: 160px;
  display: block;
  margin: 22px auto 0;
}

.xtx-mini-product ul li .tit {
  padding-top: 23px;
  font-size: 16px;
}

.xtx-mini-product ul li .desc {
  padding-top: 12px;
  color: #999;
}

.xtx-mini-product ul li .price {
  font-size: 18px;
  color: #CF4444;
  padding-top: 16px;
}

.xtx-simpla-title {
  height: 40px;
  font-size: 28px;
  text-align: center;
}

.xtx-large-brand {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

.xtx-large-brand .item {
  width: 610px;
  height: 480px;
  background: white;
  margin-bottom: 40px;
}

.xtx-large-brand .item img {
  width: 100%;
  height: 320px;
  display: block;
}

.xtx-large-brand .item .info {
  padding: 0 35px;
  position: relative;
}

.xtx-large-brand .item .info p.name {
  padding-top: 22px;
  padding-bottom: 12px;
  font-size: 20px;
}

.xtx-large-brand .item .info p.name i {
  width: 36px;
  height: 18px;
  line-height: 18px;
  background: #27BA9B;
  border-radius: 2px;
  color: #fff;
  font-size: 14px;
  display: inline-block;
  text-align: center;
}

.xtx-large-brand .item .info p.desc {
  color: #999;
  font-size: 14px;
  height: 40px;
  line-height: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  padding-right: 40px;
}

.xtx-large-brand .item .info .price {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #CF4444;
  font-size: 18px;
}

.xtx-large-brand .item .comment {
  padding: 15px 35px 0;
  line-height: 40px;
  color: #999;
}

.xtx-large-brand .item .comment .line {
  width: 100%;
  height: 1px;
  background: #E4E4E4;
}

.xtx-large-brand .item .comment .red {
  color: #CF4444;
}

.xtx-large-brand .item .comment .mr18 {
  margin-right: 18px;
}

.xtx-elevator {
  position: fixed;
  left: 50%;
  top: 280px;
  z-index: 999;
  margin-left: 640px;
  opacity: 0;
  transition: all .5s;
}

.xtx-elevator .xtx-elevator-list {
  width: 60px;
  height: 300px;
  background: #fff;
  float: right;
  border: 1px solid #f5f5f5;
  position: relative;
}

.xtx-elevator .xtx-elevator-list li {
  height: 60px;
  padding: 15px;
}

.xtx-elevator .xtx-elevator-list li a {
  width: 30px;
  height: 30px;
  display: block;
}

.xtx-elevator .xtx-elevator-list li a:hover,
.xtx-elevator .xtx-elevator-list li a.active {
  color: #27BA9B;
}

.xtx-elevator .xtx-elevator-list li a i {
  display: block;
  width: 16px;
  height: 16px;
  position: relative;
  left: 4px;
  background-position: 8px -106px;
  font-size: 20px;
  transform: rotate(-90deg);
}

index.html:





  
  小兔鲜儿 - 新鲜 惠民 快捷!
  
  
  
  



  
  
  
  
  
  

热门品牌国际经典 品质保证

你可能感兴趣的:(前端,javascript,html)