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

广州网站优化外包怎样才能在百度上发布信息

广州网站优化外包,怎样才能在百度上发布信息,保定厂家推荐信息流推广,闵行西安网站建设一、CSS3 动画 CSS3 动画是一种通过纯CSS实现动画效果的技术,它允许开发者在不使用JavaScript或Flash的情况下,为网页元素添加平滑的过渡和动画效果。CSS3 动画的引入,极大地增强了网页的表现力和用户体验。 二、 CSS3 动画的关键组成部分 1…

一、CSS3 动画

     CSS3 动画是一种通过纯CSS实现动画效果的技术,它允许开发者在不使用JavaScript或Flash的情况下,为网页元素添加平滑的过渡和动画效果。CSS3 动画的引入,极大地增强了网页的表现力和用户体验。

二、 CSS3 动画的关键组成部分

1、设置关键帧

@keyframes  animationname  {  

         from {/*CSS样式写在这里*/}    

         percentage {/*CSS样式写在这里*/}  

         to {/*CSS样式写在这里*/}

}

 2、调用关键帧

 animation 属性用于将 @keyframes 动画绑定到元素上,并控制动画的播放。它可以包含多个子属性,如 animation-nameanimation-durationanimation-timing-functionanimation-delayanimation-iteration-countanimation-direction 等

  语法 :

animation属性 :

性名称作用描述可选值默认值
animation-name指定关键帧动画名称keyframename | nonenone
animation-duration单次动画持续时间时间单位(s/ms)0s
animation-timing-function动画速度曲线ease | linear | ease-in | ease-out | ease-in-out | steps(n)ease
animation-delay动画延迟时间时间单位(允许负值)0s
animation-iteration-count动画播放次数number | infinite1
animation-direction动画播放方向normal | reverse | alternate | alternate-reversenormal
animation-fill-mode动画外样式应用none | forwards | backwards | bothnone
animation-play-state动画播放状态控制running | pausedrunning

说明:

  • animation-direction

    • 作用:控制播放方向
    • 参数:
      normal:正向播放
      reverse:反向播放
      alternate:奇数次正向,偶数次反向
      alternate-reverse:奇数次反向,偶数次正向
  • animation-fill-mode

    • 作用:设置动画执行前后样式状态
    • 参数:
      none:默认状态
      forwards:保留最后一帧样式
      backwards:应用第一帧样式
      both:同时应用前后状态
  • animation-play-state

    • 作用:控制动画播放状态
    • 参数:

                running:将暂停的动画重新播放

                paused:将正在播放的元素动画停下来

 三、CSS3 动画的优势

  • 纯CSS实现:无需依赖JavaScript或第三方库,减少了代码的复杂性和加载时间。

  • 性能优化:浏览器对CSS动画进行了优化,通常比JavaScript动画更加流畅和高效。

  • 易于维护:CSS动画与页面样式分离,使得样式和动画的维护更加容易。

  • 兼容性:现代浏览器普遍支持CSS3动画,具有良好的兼容性。

四、动画应用 

1、背景动画(通过改变背景图片的位置来实现动画效果。

<!DOCTYPE html>
<html>
<head><meta charset="utf-8"><title>背景动画</title><style>body {display: flex; /* 使用弹性布局 */justify-content: center; /* 水平居中 */align-items: center; /* 居中显示 */height: 100vh; /* 确保足够长,以便滚动 */font-size: 30px;color: #fff;background-image: -webkit-linear-gradient(125deg, #2c3e50, #27ae60, #2980b9, #e74c3c, #8e44ad); /* 渐变背景 */background-size: 400%;  /* 背景图大小 */animation: bgmove 10s infinite; /* 动画名称、持续时间、无限循环 */}/* 定义动画 */@keyframes bgmove {from {background-position: 0% 50%; /* 起始位置 */}50% {background-position: 100% 50%; /* 中间位置 */}to {background-position: 0% 50%; /* 结束位置,回到起始点形成循环效果 */}}</style>
</head>
<body><h1>Animate Background</h1>
</body>
</html>

 

2、逼真的水滴动图(通过改变元素的边框半径和阴影来实现动画。

<!DOCTYPE html>
<html>
<head><meta charset="utf-8"><title>水滴动图</title><style>* {margin: 0;padding: 0;box-sizing: border-box;}body {width: 100vw;height: 100vh;display: flex;background-color: #00a8ff;justify-content: center;}/* 水面 */.water {margin-top: 200px;width: 300px;height: 300px;border: 1px solid #000;border-radius: 72% 28% 64% 36% / 12% 17% 83% 88%;box-shadow: inset 10px 20px 30px rgba(0, 0, 0, 0.5),10px 10px 20px rgba(0, 0, 0, 0.3),15px 15px 30px rgba(0, 0, 0, 0.05),inset -10px -10px 15px rgba(255, 255, 255, 0.8);  /* 阴影效果 */animation: move 5s linear infinite alternate; /* 动画效果  */}/* 水滴 */.water::after, .water::before {content: '';position: absolute;background-color: rgba(255, 255, 255, 0.8);}/* 水滴后 */.water::after {width: 20px;height: 20px;top: 240px;left: 47%;border-radius: 9% 91% 35% 65% / 51% 17% 83% 49%;}/* 水滴前 */.water::before {width: 10px;height: 10px;top: 230px;left: 45%;border-radius: 53% 47% 46% 54% / 99% 0% 100% 1%;}/* 动画效果 */@keyframes move {25% {border-radius: 11% 89% 65% 35% / 64% 32% 68% 36%;  /* 改变形状 */}50% {border-radius: 60% 40% 65% 35% / 64% 32% 68% 36%;  /* 改变形状 */}to {border-radius: 73% 27% 65% 35% / 64% 67% 33% 36%;}}</style>
</head>
<body><div class="water"></div>
</body>
</html>

3、热点图动画(通过逐渐放大和降低透明度的圆圈来表示热点的动态变化。

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta http-equiv="X-UA-Compatible" content="ie=edge"><title>热点图动画</title><style>body {position: relative;background-color: coral;}/* 热点的位置,大小 颜色 */.beijing, .shanghai, .guangzhou {position: absolute;width: 40px;height: 10px;font-size: 12px;color: white;}/* 热点位置 */.beijing { top: 100px; left: 500px; }.shanghai { top: 250px; left: 550px; }.guangzhou { top: 350px; left: 480px; }/* 动画圆点大小,颜色,阴影 */.dot {width: 8px;height: 8px;background-color: deepskyblue;border-radius: 50%;box-shadow: 0 0 12px deepskyblue;}/* 动画圆点位置 */.bjdot, .shdot, .gzdot {position: absolute;}/* 圆点位置 */.bjdot { top: 105px; left: 485px; }.shdot { top: 255px; left: 535px; }.gzdot { top: 355px; left: 465px; }/* 动画圆点 */.dot div[class^="circle"] {position: absolute;transform: translate(-50%, -50%);margin-top: 4px;margin-left: 4px;width: 8px;height: 8px;border: 1px solid deepskyblue;box-sizing: border-box;border-radius: 50%;box-shadow: 0 0 12px deepskyblue;}/* 动画延迟时间 */.circle1 { animation: movie 3s linear infinite; }.circle2 { animation: movie 3s linear 1s infinite; }.circle3 { animation: movie 3s linear 2s infinite; }/* 动画 */@keyframes movie {0% {}70% {width: 60px;height: 60px;opacity: 0.3;}100% {width: 60px;height: 60px;opacity: 0;}}</style>
</head>
<body><div class="beijing">北京</div><div class="shanghai">上海</div><div class="guangzhou">杭州</div><div class="dot bjdot"><div class="circle1"></div><div class="circle2"></div><div class="circle3"></div></div><div class="dot shdot"><div class="circle1"></div><div class="circle2"></div><div class="circle3"></div></div><div class="dot gzdot"><div class="circle1"></div><div class="circle2"></div><div class="circle3"></div></div>
</body>
</html>

五、小结

     CSS3 动画是一种强大的工具,它允许开发者以简单而高效的方式为网页添加动画效果。通过掌握 @keyframes 规则和 animation 属性,您可以创建出丰富多样的动画效果,提升网页的用户体验。 

http://www.dtcms.com/wzjs/559468.html

相关文章:

  • 德州加盟网站建设谷德设计网百度百科
  • 定制开发电商网站建设欧泰国际物流网站
  • 精品资源共享课网站建设网站商务建设实训的意义
  • 门户网站cms产品推广软文300字
  • 网站建设公司的销售好做吗找网站建设公司需要注意什么
  • 甘肃城乡建设局网站网站如何申请微信支付
  • 免费建站网站 seo湖北省建设厅行政审批网站
  • 规划设计公司网站小程序游戏源码wordpress
  • iis7.5部署网站做网站怎样写标题
  • 手机端做网站软件做捕鱼网站电话
  • edd次元的避风港网站代理html商城网站模板下载
  • 天津网站搜索优化中国菲律宾篮球
  • 怎么用网站视频做自媒体网页制作标准
  • 如何做公司建网站方案给公司汽车报价大全
  • 河南做酒店网络系统网站南宁市网上注册公司流程
  • 创建网站域名商洛做网站电话
  • 流行网站设计著名办公空间设计
  • 做网站 用 云主机wordpress评论点赞怎么实现
  • 做外贸网站公司哪家域名注册信息可以在哪里找到
  • 网站排名优化要多少钱网站建设好吗
  • app制作教程步骤图seo网络培训机构
  • 百度站长工具如何使用正品购物平台
  • php网站开发接口文档响应式网页
  • 网站建设视频教程。网站开发温州
  • 如何seo网站互联网网站建设水平
  • 中小企业网站建设效果福州网站建设兼职
  • 路由器电脑可以做网站主机企业营销的网站
  • 怎么做外卖网站江西seo推广
  • 网站开发安全小贴士无锡市住房与城乡建设局网站
  • 云主机 做网站wordpress优酷缩略图