放肆青春的博客
首页
前端
算法
网络
面试
技术
后端
运维
杂项
数据库
工具
网址
电脑
个人
文章
  • 分类
  • 标签
  • 归档
github (opens new window)
gitee (opens new window)

放肆青春

一个前端菜鸟的技术成长之路
首页
前端
算法
网络
面试
技术
后端
运维
杂项
数据库
工具
网址
电脑
个人
文章
  • 分类
  • 标签
  • 归档
github (opens new window)
gitee (opens new window)
  • 前端

    • 前端 概览
    • 前端汇总

    • front 博文

    • front 项目总结

    • front 高级

    • front tools

  • vue

    • vue 概览
    • vue 汇总

    • vue 博文

    • vue 项目总结

    • vue 高级

  • html

    • html 概览
    • html 汇总

    • html 博文

  • css

    • css 概览
    • css 汇总

      • css 知识点总结
      • css 问题汇总
      • css 语法
      • css 技术文章
      • css 手写
        • css 手写
          • css 实现九宫格
          • 如何画一条 0.5px 的线
          • CSS 实现 16:9 的盒子,不定宽
          • css 实现 8 种三角形
          • css flex 实现骰子的六个面
          • css 实现进度条
    • css 博文

    • sass

    • less

  • js

    • javascript 概览
    • JS 汇总

    • ES6

    • JS 博文

    • JS 工具

  • node

    • node 概览
    • node 汇总

    • node 框架

    • node 博文

  • react

    • react 概览
    • react 汇总

    • react 博文

    • react 高级

  • 微信小程序

    • 微信小程序 概览
    • 微信小程序总结
    • 微信小程序文章
    • 微信小程序 博文

    • 微信小程序 高级

  • 微信公众号

    • 微信公众号 概览
    • 微信公众号总结
    • 微信公众号文章
  • 多端开发

    • 多端开发
    • dsbridge 概览
    • jsbridge 概览
    • webview
    • uniapp

      • uniapp 概览
    • taro

      • taro 概览
    • flutter

      • flutter 概览
      • flutter 环境搭建
    • electron

      • electron 概览
  • front
放肆青春
2020-12-02

css 手写

# css 手写

# css 实现九宫格

  1. flex 布局

  2. float 布局

  3. grid 布局

  4. table 布局

# 如何画一条 0.5px 的线

  1. 采用 meta viewport 的方式

<meta name="viewport" content="width=device-width, initial-scale=0.5, minimum-scale=0.5, maximum-scale=0.5"/>

注意:viewport 只针对于移动端,只在移动端上才能看到效果

  1. transform: scale()

# CSS 实现 16:9 的盒子,不定宽

# css 实现 8 种三角形

https://www.cnblogs.com/chengxs/p/11406278.html (opens new window)

# css flex 实现骰子的六个面

https://www.cnblogs.com/ycherry/p/8184125.html (opens new window)

# css 实现进度条

<!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" />
    <style>
      .circle_process {
        position: relative;
        width: 199px;
        height: 200px;
      }

      .circle_process .wrapper {
        width: 100px;
        height: 200px;
        position: absolute;
        top: 0;
        overflow: hidden;
      }

      .circle_process .right {
        right: 0;
      }

      .circle_process .left {
        left: 0;
      }

      .circle_process .circle {
        width: 160px;
        height: 160px;
        border: 20px solid transparent;
        border-radius: 50%;
        position: absolute;
        top: 0;
        transform: rotate(-135deg);
      }

      .circle_process .rightcircle {
        border-top: 20px solid green;
        border-right: 20px solid green;
        right: 0;
        animation: circle_right 5s linear infinite;
        -webkit-animation: circle_right 5s linear infinite;
      }

      .circle_process .leftcircle {
        border-bottom: 20px solid green;
        border-left: 20px solid green;
        left: 0;
        animation: circle_left 5s linear infinite;
        -webkit-animation: circle_left 5s linear infinite;
      }

      @keyframes circle_right {
        0% {
          -webkit-transform: rotate(-135deg);
        }

        50%,
        100% {
          -webkit-transform: rotate(45deg);
        }
      }

      @keyframes circle_left {
        0%,
        50% {
          -webkit-transform: rotate(-135deg);
        }

        100% {
          -webkit-transform: rotate(45deg);
        }
      }
    </style>
  </head>

  <body>
    <div class="circle_process">
      <div class="wrapper right">
        <div class="circle rightcircle"></div>
      </div>
      <div class="wrapper left">
        <div class="circle leftcircle" id="leftcircle"></div>
      </div>
    </div>
  </body>
</html>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90

参考:https://sevenhao.github.io/qhao/web/css-aritcle/css-property/CSS实现圆形进度条.html (opens new window)

更新时间: 2/10/2022, 7:21:32 PM
css 技术文章
css 隔离

← css 技术文章 css 隔离→

最近更新
01
前端权限管理
02-24
02
vue2指令
02-24
03
vue2 hook
02-24
更多文章>
Theme by Vdoing | Copyright © 2019-2022 放肆青春
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式