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

css画一个卡通动画

1、效果图

 

2、代码

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .container {
        position: relative;
        display: flex;
        width: 100%;
        height: 100vh;
        justify-content: center;
        align-items: center;
      }
      .smiley__face {
        padding: 10px;
        position: absolute;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        border: 5px solid #2263b9;
        border: 5px solid #2a7ede;
        width: 100px;
        height: 120px;
        background: #ffffff;
        border-radius: 15px;
        overflow: hidden;
      }
      .face {
        background: #2a7ede;
        width: 100%;
        height: 90px;
        border-radius: 5px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        position: relative;
        overflow: hidden;
        z-index: 1;
      }
      .eyes {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 20px;
        width: 60%;
      }
      .eye {
        display: block;
        width: 15px;
        height: 15px;
        background: #2c3e50;
        border-radius: 50px;
      }
      .mouth {
        display: block;
        width: 32px;
        height: 20px;
        background: #2c3e50;
        border-top-left-radius: 15px;
        border-top-right-radius: 15px;
        border-bottom-left-radius: 50px;
        border-bottom-right-radius: 50px;
        position: relative;
        overflow: hidden;
      }
      .mouth::before {
        content: "";
        display: block;
        width: 20px;
        height: 10px;
        background: #e74c3c;
        border-radius: 50%;
        position: absolute;
        left: 50%;
        bottom: 2px;
        transform: translateX(-50%);
      }
      .field{
        position: absolute;
        bottom: 8px;
        left: 31px;
      }
    </style>
  </head>
  <body>
    <div class="container">
      <div class="smiley__face smiley__face--01">
        <div class="face">
          <div class="eyes">
            <div class="eye eye__left"></div>
            <div class="eye eye__right"></div>
          </div>
          <div class="mouth"></div>
        </div>
        <div class="field">域管理</div>
      </div>
    </div>
  </body>
</html>

相关文章:

  • 在 vue 中使用 vue-typed-js 实现打字机效果
  • mac电脑安装item2、oh-my-zsh
  • Mac版本git下载和使用
  • 推荐一个包含很多工具的网站
  • vscode设置侧边栏字体大小
  • 微信小程序上传:form-data
  • mac显示.git文件
  • 微信小程序图片上传一直loading中,上传没反应
  • el-table拖动排序
  • vue项目进行前端埋点,记录页面菜单停留时间
  • input实现在移动端软键盘中显示“搜索”案件的注意事项
  • export, import 的用法详解
  • vue中ref的作用及用法
  • Vue中数据缓存localStroage
  • keep-alive实现数据缓存
  • [分享]iOS开发 - 实现UITableView Plain SectionView和table不停留一起滑动
  • [译]前端离线指南(上)
  • C++11: atomic 头文件
  • CentOS6 编译安装 redis-3.2.3
  • crontab执行失败的多种原因
  • css的样式优先级
  • ES6 学习笔记(一)let,const和解构赋值
  • Java 11 发布计划来了,已确定 3个 新特性!!
  • MQ框架的比较
  • spring boot下thymeleaf全局静态变量配置
  • 基于HAProxy的高性能缓存服务器nuster
  • 聊聊spring cloud的LoadBalancerAutoConfiguration
  • 推荐一个React的管理后台框架
  • 小程序上传图片到七牛云(支持多张上传,预览,删除)
  • mysql 慢查询分析工具:pt-query-digest 在mac 上的安装使用 ...
  • TPG领衔财团投资轻奢珠宝品牌APM Monaco
  • 京东物流联手山西图灵打造智能供应链,让阅读更有趣 ...
  • 支付宝花15年解决的这个问题,顶得上做出十个支付宝 ...
  • ​LeetCode解法汇总518. 零钱兑换 II
  • ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLTr
  • #AngularJS#$sce.trustAsResourceUrl
  • (16)Reactor的测试——响应式Spring的道法术器
  • (NO.00004)iOS实现打砖块游戏(九):游戏中小球与反弹棒的碰撞
  • (编译到47%失败)to be deleted
  • (附源码)ssm基于微信小程序的疫苗管理系统 毕业设计 092354
  • (附源码)基于SSM多源异构数据关联技术构建智能校园-计算机毕设 64366
  • (经验分享)作为一名普通本科计算机专业学生,我大学四年到底走了多少弯路
  • (六)vue-router+UI组件库
  • (顺序)容器的好伴侣 --- 容器适配器
  • (原+转)Ubuntu16.04软件中心闪退及wifi消失
  • (转)详解PHP处理密码的几种方式
  • .gitignore文件—git忽略文件
  • .NET CF命令行调试器MDbg入门(三) 进程控制
  • .NET 使用 JustAssembly 比较两个不同版本程序集的 API 变化
  • .net 重复调用webservice_Java RMI 远程调用详解,优劣势说明
  • .net6解除文件上传限制。Multipart body length limit 16384 exceeded
  • .Net各种迷惑命名解释
  • .NET学习教程二——.net基础定义+VS常用设置
  • .NET运行机制
  • @ 代码随想录算法训练营第8周(C语言)|Day57(动态规划)