首页 > 其他分享 >纯css图标

纯css图标

时间:2023-03-16 09:48:08浏览次数:41  
标签:solid 2px height content position border css 图标

/*对号*/
.gou{
    width: 9px;
    height: 18px;
    border-right:2px solid #f39800;
    border-bottom:2px solid #f39800;
    transform: rotate(40deg);
}

/*叉号*/
.cha{
    width: 20px;
    height: 20px;
    margin: auto;
    position: relative; 
}
.cha::before,
.cha::after{
  content: "";
  position: absolute;  /*方便进行定位*/
  height: 20px;
  width: 1.5px;
  top: 2px;
  right: 9px;  /*设置top和right使图像在20*20框中居中*/
  background: #f39800;
}
.cha::before{
  transform: rotate(45deg);  /*进行旋转*/
}
.cha::after{
  transform: rotate(-45deg);
}

/*上三角*/
.triangle{
    position: relative;
}
.triangle::after {
    content: '';
    width: 0;
    height: 0;
    border: 0.5rem solid transparent;
    border-bottom: 0.5rem solid #000;
    position: absolute;
    top: -1rem;
    left: 48%;
    transform: translateX(-50%);
    z-index: 100;
}

/*大于号*/
.greater{
    position: relative;
}
.greater:after{
    content: '';
    width: 12px;
    height: 12px;
    position: absolute;
    right: 5px;
    bottom: 5px;
    border-left: 2px solid #000;
    border-bottom: 2px solid #000;
    transform: translate(0,-50%) rotate(-135deg);
}

很多图标也可以通过content字符实现,例如 通过css实现对勾(√)和叉号(×), 能用content字符实现的图标有,各种箭头,大于小于号,对号(样式有问题),叉号,各种三角,星号,

雪花,象棋,扑克牌,希腊字母,天空,植物,手型,铅笔,笔型,十字等,可首选content字符来实现图标。

 

出处:简单的使用css画勾、叉、三角、大于号

标签:solid,2px,height,content,position,border,css,图标
From: https://www.cnblogs.com/mengff/p/17221153.html

相关文章

  • css
    CSS选择器CSS选择器【常用】元素选择器:h1,img,p{}类选择器:.className{}id选择器:#id{}通配符选择器:*{}CSS属性【常用】字体大小:font-size字体颜色:color......
  • css属性计算过程
    首先我们在HTML中使用h1标签展现标题时,我们没有设置该h1的任何央视,但是却能看到该h1由一定的默认样式,例如有默认的字体大小、默认的颜色。那么问题来了,我们这个h1元素上......
  • MyBlogCSS
    温馨提示:CSS代码较长,将考验浏览器性能,请酌情阅读。点击查看代码a,button{outline:0}.day,.entrylistItem,.entrylistPostSummary,.feedbackCon,.feedbac......
  • VUE基础:组件CSS样式、props属性
    VUE基础部分组件css样式例子<stylelang="less">//这里记得改名,然后给div也加名字.comName-container{padding:1020px20px;background-color:lightskyblue......
  • css包含块
    什么是包含块?对于元素的尺寸和位置,会受它的包含块所影响。对于一些属性,例如:width,height,padding,margin,绝对定位元素的偏移值(position被设置成absolute或者fixed),当我们对其......
  • 框选人物的例子+改变鼠标图标(类似红警)
    usingSystem.Collections;usingSystem.Collections.Generic;usingUnityEngine;publicclassSetBox:MonoBehaviour{//这个是换鼠标图标publicTexture2Dtex......
  • TortoiseGit 忽略文件图标显示已提交或状态图标不显示或状态图标显示不完全
    1.右键打开TortoiseGit> settings页面,选择OverlayHandlers2.点击 StartRegistryEdit打开注册表 3.在弹出的注册表中把Tortoise的每一项前面多加几个空格,排序会......
  • css 背景 background
    属性值说明CSSbackground-color指定要使用的背景颜色1background-position指定背景图像的位置1background-size指定背景图片的大小3background-......
  • CSS - css初始化
    常见的初始化:html,body,ul,li,ol,dl,dd,dt,p,h1,h2,h3,h4,h5,h6,form,fieldset,legend,img{margin:0;padding:0;}fieldset,img,in......
  • less & saas/scss & css 深度选择器语法在 Vue2 & Vue3中的使用
    vue2中原生css>>>.el-card__header saas\scss::v-deep.el-card__headerless/deep/.el-card__header vue3中:deep(){......