当前位置: 首页 > news >正文

重庆建设网站哪家好营销策略是什么意思

重庆建设网站哪家好,营销策略是什么意思,开发工程师是什么,外贸推广的几种方式以及效果排行效果演示 实现了一个简单的网页布局,其中包含了五个不同的盒子,每个盒子都有一个不同的背景图片,并且它们之间有一些间距。当鼠标悬停在某个盒子上时,它的背景图片会变暗,并且文字会变成白色。这些盒子和按钮都被放在一…

效果演示

37-全景轮播-min.gif

实现了一个简单的网页布局,其中包含了五个不同的盒子,每个盒子都有一个不同的背景图片,并且它们之间有一些间距。当鼠标悬停在某个盒子上时,它的背景图片会变暗,并且文字会变成白色。这些盒子和按钮都被放在一个容器中,整个页面看起来像一个画廊。

Code

<div class="container"><div id="slide"><div class="item" style="background-image:url('./img/章若楠01.jpg')"></div><div class="item" style="background-image:url('./img/鞠婧祎01.jpg')"></div><div class="item" style="background-image:url('./img/鞠婧祎02.jpg')"></div><div class="item" style="background-image:url('./img/鞠婧祎06.jpg')"></div><div class="item" style="background-image:url('./img/鞠婧祎04.jpg')"></div><div class="item" style="background-image:url('./img/鞠婧祎07.jpg')"></div></div><div class="buttons"><div class="left">< Prev</div><div class="center">下载壁纸</div><div class="right">Next ></div></div></div>
</div>
* {margin: 0;padding: 0;box-sizing: border-box;
}.container {width: 100vw;height: 100vh;position: relative;overflow: hidden;
}.item {width: 240px;height: 160px;position: absolute;top: 50%;left: 0;transform: translateY(-50%);border-radius: 10px;box-shadow: 0 30px 50px #505050;background-size: cover;background-position: center;transition: 1s;
}.item:nth-child(1),
.item:nth-child(2) {left: 0;top: 0;width: 100%;height: 100%;transform: translateY(0);box-shadow: none;border-radius: 0;
}.item:nth-child(3) {left: 70%;
}.item:nth-child(4) {left: calc(70% + 250px);
}.item:nth-child(5) {left: calc(70% + 500px);
}.item:nth-child(n+6) {left: calc(70% + 750px);opacity: 0;
}.buttons {width: 100%;position: absolute;bottom: 50px;margin-left: -50px;text-align: center;display: flex;justify-content: center;
}.buttons div {width: 120px;height: 50px;line-height: 50px;text-align: center;border-radius: 5px;margin: 0 25px;transition: .5s;cursor: pointer;user-select: none;font-size: 20px;color: #fff;background-color: rgba(0, 0, 0, 0.4);box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.2);
}
const leftBtn = document.querySelector(".buttons .left")
const rightBtn = document.querySelector(".buttons .right")
const slide = document.querySelector("#slide")
let openClick = true // 节流处理 (保证动画执行过程,按钮不被重复点击)leftBtn.addEventListener("click", () => {if (openClick) {openClick = false // 触发点击后,禁用按钮const items = document.querySelectorAll(".item")slide.prepend(items[items.length - 1])setTimeout(() => openClick = true, 1000) // 1s 再开放按钮的点击}
})
rightBtn.addEventListener("click", () => {if (openClick) {openClick = falseconst items = document.querySelectorAll(".item")slide.appendChild(items[0])setTimeout(() => openClick = true, 1000)}
})

实现思路拆分

* {margin: 0;padding: 0;box-sizing: border-box;
}

这段代码是设置全局的CSS样式,包括设置元素的盒模型为border-box,即盒模型的宽度和高度包括了元素的边框和内边距,而不是只包括元素的内容。

.container {width: 100vw;height: 100vh;position: relative;overflow: hidden;
}

这段代码是设置容器的CSS样式,包括设置容器的宽度和高度为100vw和100vh,即视口的宽度和高度。同时,设置容器的定位为相对定位,即相对于其父元素进行定位。最后,设置容器的溢出属性为隐藏,即超出容器范围的元素不会被显示出来。

.item {width: 240px;height: 160px;position: absolute;top: 50%;left: 0;transform: translateY(-50%);border-radius: 10px;box-shadow: 0 30px 50px #505050;background-size: cover;background-position: center;transition: 1s;
}

这段代码是设置盒子的CSS样式,包括设置盒子的宽度和高度为240px和160px,即盒子的大小。同时,设置盒子的定位为绝对定位,即相对于其父元素进行定位。最后,设置盒子的边框半径为10px,即盒子的圆角。盒子的背景图片大小为cover,即覆盖整个盒子。背景图片的位置为居中对齐。最后,设置盒子的过渡效果为1秒,即过渡效果的时间为1秒。

.item:nth-child(1),
.item:nth-child(2) {left: 0;top: 0;width: 100%;height: 100%;transform: translateY(0);box-shadow: none;border-radius: 0;
}

这段代码是设置第一个和第二个盒子的CSS样式,包括将它们的位置设置为0,即它们覆盖在容器的最上层。同时,将它们的高度设置为100%,即它们覆盖在容器的整个高度。最后,将它们的变换属性设置为 translateY(0),即它们不会向下移动。同时,将它们的阴影和边框半径设置为0,即它们没有阴影和边框。

.item:nth-child(3) {left: 70%;
}

这段代码是设置第三个盒子的CSS样式,包括将它的位置设置为距离容器左侧70%的位置。

.item:nth-child(4) {left: calc(70% + 250px);
}

这段代码是设置第四个盒子的CSS样式,包括将它的位置设置为距离第三个盒子右侧250px的位置。

.item:nth-child(5) {left: calc(70% + 500px);
}

这段代码是设置第五个盒子的CSS样式,包括将它的位置设置为距离第三个盒子右侧500px的位置。

.item:nth-child(n+6) {left: calc(70% + 750px);opacity: 0;
}

这段代码是设置所有盒子的CSS样式,包括将它们的位置设置为距离第三个盒子右侧750px的位置。同时,将它们的不透明度设置为0,即它们不可见。

.buttons {width: 100%;position: absolute;bottom: 50px;margin-left: -50px;text-align: center;display: flex;justify-content: center;
}

这段代码是设置按钮的CSS样式,包括设置按钮的宽度为100%,即按钮的大小与容器相同。同时,将按钮的位置设置为距离容器底部50px的位置。最后,将按钮的对齐方式设置为居中对齐,即按钮在水平方向上居中对齐。

.buttons div {width: 120px;height: 50px;line-height: 50px;text-align: center;border-radius: 5px;margin: 0 25px;transition:.5s;cursor: pointer;user-select: none;font-size: 20px;color: #fff;background-color: rgba(0, 0, 0, 0.4);box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.2);
}

这段代码是设置按钮的CSS样式,包括设置按钮的宽度为120px,高度为50px,即按钮的大小。同时,设置按钮的行高为50px,即按钮的高度。按钮的文本对齐方式为居中对齐,即文本在水平方向上居中对齐。按钮的边框半径为5px,即按钮的圆角。按钮的外边距为0 25px,即按钮在水平方向上左右两侧的距离为25px。按钮的过渡效果为0.5秒,即过渡效果的时间为0.5秒。按钮的光标属性为pointer,即鼠标悬停在按钮上时,鼠标的形状会变成手型。按钮的用户选择属性为none,即用户不能选中按钮中的文本。按钮的字体大小为20px,即按钮的文本大小。按钮的文本颜色为白色,即按钮的文本颜色。按钮的背景颜色为rgba(0, 0, 0, 0.4),即按钮的背景颜色为黑色,透明度为0.4。按钮的阴影属性为2px 2px 2px rgba(0, 0, 0, 0.2),即按钮的阴影为2px 2px 2px黑色,透明度为0.2。

http://www.hkea.cn/news/640448/

相关文章:

  • php网站架设教程英雄联盟韩国
  • 做毕设好的网站百度客服电话24小时
  • 上海手机网站建设电话咨询seo综合查询系统
  • wordpress 4.6 中文版沈阳seo
  • 文件管理软件天津搜索引擎优化
  • 九亭网站建设全国疫情高峰时间表最新
  • 青岛网站建设公司武汉seo收费
  • mvc网站建设的实验报告怎么做优化
  • 有官网建手机网站千锋教育培训多少钱费用
  • b2c交易模式的网站有哪些百度营销客户端
  • flash 学习网站重庆网站seo多少钱
  • 年终总结ppt模板免费下载网站小红书seo排名规则
  • 自己架设网站口碑营销的产品有哪些
  • 湖北省网站备案最快几天天津百度推广排名优化
  • app在线开发制作平台seo网络优化前景怎么样
  • 商务网站的基本情况网站建设工作总结
  • 山西建设厅网站网络销售怎么聊客户
  • 软装素材网站有哪些seo网络排名优化哪家好
  • 邯郸市做网站建设网络口碑营销案例分析
  • 罗湖网站建设联系电话西安核心关键词排名
  • 如何编写网站电脑清理软件十大排名
  • 怎么给企业制作网站seo关键词排名优化哪好
  • 高仿服装网站建设西安百度关键词推广
  • 网站单页面怎么做的百度seo站长工具
  • 网站建设谢辞企业营销型网站有哪些
  • 免费网站制作申请行业关键词一览表
  • 网站建设费关键词排名提高方法
  • 搭建淘宝客网站源码最近发生的新闻事件
  • 网站模版网网站关键词排名优化价格
  • 做网站去哪里全国免费发布广告信息平台