璞子

vuePress-theme-reco 璞子    2020 - 2021
璞子 璞子

Choose mode

  • dark
  • auto
  • light
主页
分类
  • 2020-11
  • 2020-09
  • 2020-08
  • 2020-12
  • 2020-10
标签
关于
  • 前言
时间轴
GitHub (opens new window)
author-avatar

璞子

13

Article

8

Tag

主页
分类
  • 2020-11
  • 2020-09
  • 2020-08
  • 2020-12
  • 2020-10
标签
关于
  • 前言
时间轴
GitHub (opens new window)
  • programs

    • 【git基本操作】
    • 【tco-ui组件】
    • 【excel在线预览】
    • 【tooltip】
    • 【webpack静态资源处理】
    • 【中国地图】
    • 【太阳动画】
    • 【前端开发规范】
    • 【时间格式处理】
    • 【防抖和节流】
    • 【面试题整理】

【tooltip】

vuePress-theme-reco 璞子    2020 - 2021

【tooltip】

puzi 2020-12-12 css
   <div class="tooltip-list">
    <div class="tooltip">
    </div>
    <ul class="triangle-list">
        <li class="triangle"></li>
        <li class="triangle-up"></li>
        <li class="triangle-down"></li>
        <li class="triangle-left"></li>
        <li class="triangle-right"></li>
        <li class="triangle-topright"></li>
        <li class="triangle-topleft"></li>
        <li class="triangle-bottomleft"></li>
        <li class="triangle-bottomright"></li>
    </ul>
</div>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
    .triangle{
        border-top: 100px solid red;
        border-bottom: 100px solid blue;
        border-left: 100px solid yellow;
        border-right: 100px solid green;
    }
    .triangle-up{
        border-top: 100px solid red;
        border-left: 100px solid transparent;
        border-right: 100px solid transparent;
    }
    .triangle-down{
        border-bottom: 100px solid blue;
        border-left: 100px solid transparent;
        border-right: 100px solid transparent;
    }
    .triangle-left{
        border-left: 100px solid yellow;
        border-top: 100px solid transparent;
        border-bottom: 100px solid transparent;
    }
    .triangle-right{
        border-right: 100px solid green;
        border-top: 100px solid transparent;
        border-bottom: 100px solid transparent;
    }


    .triangle-topright{
        border-top: 100px solid green;
        border-left: 100px solid transparent;
    }
    .triangle-topleft{
        border-top: 100px solid green;
        border-right: 100px solid transparent;
    }
    .triangle-bottomleft{
        border-bottom: 100px solid green;
        border-right: 100px solid transparent;
    }
    .triangle-bottomright{
        border-bottom: 100px solid green;
        border-left: 100px solid transparent;
    }

    .tooltip{
        width: 200px;
        height: 400px;
        border-radius: 20px;
        border:2px solid red;
        position: relative;
        margin-top: 100px;
        background:#ccc;
    }
    .tooltip:before{
        content: '';
        display: block;
        position: absolute;
        top: -20px;
        left: 80px;
        border-bottom: 20px solid red;
        border-left: 20px solid transparent;
        border-right: 20px solid transparent;
    }
    .tooltip:after{
        content: '';
        display: block;
        position: absolute;
        top: -18px;
        left: 80px;
        border-bottom: 20px solid #ccc;
        border-left: 20px solid transparent;
        border-right: 20px solid transparent;
    }
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