zoukankan      html  css  js  c++  java
  • 利用纯css写三角形,弧度箭头,吃豆人,气泡。放大镜,标签的源码

    1、  向上三角形
      CSS核心代码
      .triangle-up {
       0;
       border-left: 50px solid transparent;
       border-right: 50px solid transparent;
       border-bottom: 100px solid red;
      }
    2、  左上三角形
    CSS核心代码
    .triangle-topleft {
    0;
    border-top: 100px solid red;
    border-right: 100px solid transparent;
    }
    3、  弧形尾箭头
    CSS核心代码
      .curvedarrow {
       position: relative;
       0;
       border-top: 90px solid transparent;
       border-right: 90px solid red;
       transform: rotate(10deg) translateX(100%);
      }
      .curvedarrow:after {
       content: "";
       position: absolute;
       border: 0 solid transparent;
       border-top: 30px solid red;
       border-radius: 200px 0 0 0;
       top: -120px; left: -90px;
       120px; height: 120px;
       transform: rotate(45deg);
      }
    4、  吃豆人
    CSS核心代码:
      .pacman {
       0px; height: 0px;
       border-right: 60px solid transparent;
       border-top: 60px solid red;
       border-left: 60px solid red;
       border-bottom: 60px solid red;
       border-top-left-radius: 60px;
       border-top-right-radius: 60px;
       border-bottom-left-radius: 60px;
       border-bottom-right-radius: 60px;
      }
    5、  带尖角的说话泡泡
    CSS核心代码:
      .talkbubble {
       120px; height: 80px;
       background: red;
       position: relative;
       border-radius: 10px;
      }
      .talkbubble:before {
       content: "";
       position: absolute;
       right: 100%; top: 26px;
       border-top: 13px solid transparent;
       border-right: 26px solid red;
       border-bottom: 13px solid transparent;
      }
    6、bilibili电视机
    CSS核心代码
      .tv {
       position: relative;
       200px; height: 150px;
       margin: 20px 0;
       background: red;
       border-radius: 50% / 10%;
       color: white;
       text-align: center;
       text-indent: .1em;
      }
      .tv:before {
       content: '';
       position: absolute;
       top: 10%; bottom: 10%; right: -5%; left: -5%;
       background: inherit;
       border-radius: 5% / 50%;
      }
    7、放大镜
    .magnifying-glass {
    font-size: 10em;
    display: inline-block;
    0.4em; height: 0.4em;
    border: 0.1em solid red;
    position: relative;
    border-radius: 0.35em;
    }
    .magnifying-glass:before {
    content: "";
    display: inline-block;
    position: absolute;
    right: -0.25em; bottom: -0.1em;
    border- 0;
    background: red;
    0.35em; height: 0.08em;
    transform: rotate(45deg);
    }
    8、长长的指向图形
    CSS核心代码:
    .pointer {
    200px; height: 40px;
    position: relative;
    background: red;
    }
    .pointer:after {
    content: "";
    position: absolute;
    left: 0; bottom: 0;
    border-left: 20px solid white;
    border-top: 20px solid transparent;
    border-bottom: 20px solid transparent;
    }
    .pointer:before {
    content: "";
    position: absolute;
    right: -20px; bottom: 0;
    border-left: 20px solid red;
    border-top: 20px solid transparent;
    border-bottom: 20px solid transparent;
    }
    上面展示的效果可能部分实用性不大,但是使用css制作三角和圆有效果应用还是很多了,特别是用来制作tips效果。
  • 相关阅读:
    Docker笔记
    使用NextCloud搭建私有云盘
    docker轻量级管理工具
    docker仓库使用+harbor私有仓库部署
    防DDOS攻击解决方案
    MongoDB非关系型数据库
    监控磁盘使用率解决方案
    部署SonarQube代码质量检查7.7版本
    Jenkins的权限控制
    Jenkins分布式构建
  • 原文地址:https://www.cnblogs.com/zxlone/p/11568016.html
Copyright © 2011-2022 走看看