纯CSS实现内容放大缩小效果
先搭架子

再实现第一个内容


填充更多内容


拆掉border,查看最终效果

html代码
<!-- 服务 -->
<div class="service">
<div class="service-title">
创新服务
</div>
<div class="service-container">
<div class="service-item">
<div class="service-item-common">
<div class="service-item-icon">
<img src="/Index/Index/image/innovate/yunjisuan.png" alt="">
</div>
<div class="service-item-title">
云计算平台
</div>
</div>
<div class="service-item-hover">
<div class="service-item-icon-hover">
<img src="/Index/Index/image/innovate/yunjisuan1.png" alt="">
</div>
<div class="service-item-title-hover">
云计算平台
</div>
<div class="service-item-content-hover">
<p>SaaS化的电商计算平台</p>
<p>提供标准化的服务接口与数据接口<p>
<p>电商基础服务产品化<p>
</div>
</div>
</div>
<div class="service-item">
<div class="service-item-common">
<div class="service-item-icon">
<img src="/Index/Index/image/innovate/yunshengtai.png" alt="">
</div>
<div class="service-item-title">
云生态平台
</div>
</div>
<div class="service-item-hover">
<div class="service-item-icon-hover">
<img src="/Index/Index/image/innovate/yunshengtai1.png" alt="">
</div>
<div class="service-item-title-hover">
云生态平台
</div>
<div class="service-item-content-hover">
<p>SaaS化的电子商务应用平台</p>
<p>面向不同体量级别的品牌客户<p>
<p>依照需求制定规划,精简流程<p>
<!-- <p>优化预算支出与业务能力<p>-->
</div>
</div>
</div>
<div class="service-item">
<div class="service-item-common">
<div class="service-item-icon">
<img src="/Index/Index/image/innovate/danao.png" alt="">
</div>
<div class="service-item-title">
科技大脑
</div>
</div>
<div class="service-item-hover">
<div class="service-item-icon-hover">
<img src="/Index/Index/image/innovate/danao1.png" alt="">
</div>
<div class="service-item-title-hover">
科技大脑
</div>
<div class="service-item-content-hover">
<p>用AI技术解决电商场景问题,轻松实现提升</p>
<p>基于大数据和深度学习,识别图片、视频中的视觉内容<p>
<p>构建知识图谱,挖掘潜在商业机会<p>
</div>
</div>
</div>
<div class="service-item">
<div class="service-item-common">
<div class="service-item-icon">
<img src="/Index/Index/image/innovate/dashuju.png" alt="">
</div>
<div class="service-item-title">
大数据平台
</div>
</div>
<div class="service-item-hover">
<div class="service-item-icon-hover">
<img src="/Index/Index/image/innovate/dashuju1.png" alt="">
</div>
<div class="service-item-title-hover">
大数据平台
</div>
<div class="service-item-content-hover">
<p>以核心技术能力为依托,提供数据产品和分析服务</p>
<p>AI人工智能决策<p>
<!-- <p>与国内外知名学府深度合作智能工具<p>-->
<p>提升商业效率,开拓业务场景,优化用户体验<p>
</div>
</div>
</div>
</div>
</div>
css代码
.service {
height: 608px;
background-color: #373F5E;
.service-title {
font-size: 30px;
font-weight: bold;
color: #FFFFFF;
margin-top: 100px;
text-align: center;
}
.service-container {
width: 1200px;
//border:1px solid red;
margin:0 auto;
margin-top: 60px;
display: flex;
justify-content: center;
.service-item {
width: 248px;
height: 180px;
//border:1px solid blue;
margin-top: 60px;
transition: all 0.4s ease; /* 柔和过渡 */
background-color: #FFFFFF;
.service-item-icon {
display: flex;
justify-content: center;
margin-top: 56px;
}
.service-item-title {
font-size: 18px;
color: #222222;
text-align: center;
margin-top: 20px;
}
.service-item-hover {
display: none;
}
}
.service-item:hover {
//transform: scale(1.66, 1.66); /* 其他元素位移不会变动 */
width: 450px;
height: 300px;
margin-top: 0px;
.service-item-common {
display: none;
}
.service-item-hover {
display: block;
.service-item-icon-hover {
display: flex;
justify-content: center;
margin-top: 52px;
}
.service-item-title-hover {
font-size: 20px;
color: #222222;
font-weight: bold;
text-align: center;
margin-top: 20px;
}
.service-item-content-hover {
margin-top: 24px;
text-align: center;
line-height: 32px;
font-size: 14px;
}
}
}
.service-item:nth-child(n+2) {
margin-left: 2px;
}
}
}
这里巧妙的运用了hover属性,结合transition平滑过渡。不需要js,一样可以实现动态效果。
纯CSS实现内容放大缩小效果的更多相关文章
- css scale 元素放大缩小效果
<style> .trans-scale { width: 300px; height:300px; margin:100px auto; background:#99F; transit ...
- 纯CSS实现3D正方体动画效果
前言 纯CSS实现3D正方体动画效果,此方法是通过transform的旋转(rotate)和位移(translate)实现的,具体效果是鼠标滑过时正方体的一个面会产生位移 效果图
- 制作一个顶部图片可以拉伸放大缩小效果的tableViewHeader
最近负责公司项目个人中心的项目模块研发,首页是一个头部图片可以拉伸放大缩小效果的tableViewHeader,今天这个demo和教程我增加了模糊效果和头像缩小效果.具体效果如图: 如果这个效果是想要 ...
- 纯CSS实现的风车转动效果特效演示
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content ...
- 【CSS】纯css实现立体摆放图片效果
1. 元素的 width/height/padding/margin 的百分比基准 设置 一个元素 width/height/padding/margin 的百分比的时候,大家可知道基准是什么? 举 ...
- 自定义ImageView实现图片手势滑动,多点触摸放大缩小效果
首先呢,还是一贯作风,我们先来看看众多应用中的示例:(这种效果是很常见的,可以说应用的必须品.) 搜狐客户端 ...
- html 图片在一个div中放大缩小效果
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> &l ...
- 纯CSS实现轮播图效果,你不知道的CSS3黑科技
前言 轮播图已经是一个很常见的东西,尤其是在各大App的首页顶部栏,经常会轮番显示不同的图片. 一提到轮播图如何实现时,很多人的第一反应就是使用Javascript的定时器,当然这种方法是可以实现的. ...
- 一个CSS+jQuery的放大缩小动画效果
日期: 2013年9月23日 作者:铁锚 // 今天帮朋友写了一些代码,自己觉得写着写着,好几个版本以后,有点满意,于是就贴出来. // 都是定死了的.因为需求就只有4个元素.如果是要用CSS的cla ...
随机推荐
- hibernate学习笔记(1)结构与基本数据类型
一,概览 Hibernate负责从Java类到数据库表的映射,以及从Java数据类型到SQL数据类型的映射.另外还提供数据查询和检索功能.它可以显着减少在SQL和JDBC中手动处理数据的开发时间. ...
- 手机用itunes安装更新系统
1.[Shift+更新]:仅对固件进行更新,保留现有资料和已经安装的程序.但是已经越狱的iPhone或iPad禁止使用此方法!否则有后遗症!没有越狱的iPhone或iPad则可以直接使用此方式.2.[ ...
- Linux-yum安装和相关命令
Linux-yum安装和相关命令 一 yum yum命令是在Fedora和RedHat以及SUSE中基于rpm的软件包管理器,它可以使系统管理人员交互和自动化地更细与管理RPM软件包,能够从指定的服务 ...
- Vue-Cli程序环境搭建
环境搭建 ##1.下载node.js cmd输入 node -v 查看是否能够正确打印出版本号 cmd输入 npm -v 查看是否能够正确打印出版本号 ##2.安装node.js淘宝镜像加速器 ### ...
- 彻底掌握 AQS
前言 AQS( AbstractQueuedSynchronizer )是一个用来构建锁和同步器(所谓同步,是指线程之间的通信.协作)的框架,Lock 包中的各种锁(如常见的 ReentrantLoc ...
- 【poj 1061】青蛙的约会(数论--拓展欧几里德 求解同余方程)
题意:已知2只青蛙的起始位置 a,b 和跳跃一次的距离 m,n,现在它们沿着一条长度为 l 的纬线(圈)向相同方向跳跃.问它们何时能相遇?(好有聊的青蛙 (΄◞ิ౪◟ิ‵) *)永不相遇就输出&quo ...
- 牛客练习赛70 D.数树 (模拟,STL)
题意:每次有\(3\)中操作,对两个点连条边,删去某条边,或者问当前大小不为\(1\)的树的数量.连重边或者删去一条不存在的边,这样的白痴操作可以无视qwq. 题解:水题,用map存一下pair然后分 ...
- JavaScript——三
任务: 其中的"options = options || {}"就代表如果options是一个真的对象,就使用它,否则就给他默认值 在Node函数中: 函数中的this指向wind ...
- CentOS 7 架设LNMP动态网站
1.安装Nginx 1)使用Nginx官方的yum源 [root@localhost ~]# vim /etc/yum.repos.d/nginx.repo [nginx] name=nginx re ...
- MySQL 事务日志
重做日志(Redo log) 重做日志(Redo log),也叫做前滚日志,存放在如下位置,轮询使用,记录着内存中数据页的变化,在事务 ACID 过程中,主要实现的是 D(Durability)的作用 ...