分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 技术分享

css3 小三角的用法

发布时间:2023-09-06 02:21责任编辑:郭大石关键词:暂无标签
<div class="arrow-up"> ????<!--向上的三角--></div><div class="arrow-down"> ???<!--向下的三角--></div><div class="arrow-left"> ???<!--向左的三角--></div><div class="arrow-right"> ???<!--向右的三角--></div>

下面用CSS3分别实现向上、下、左、右的三角形

/*箭头向上*/.arrow-up { ???width:0; ????height:0; ????border-left:30px solid transparent; ???border-right:30px solid transparent; ???border-bottom:30px solid #fff;} ????/*箭头向下*/.arrow-down { ???width:0; ????height:0; ????border-left:20px solid transparent; ???border-right:20px solid transparent; ???border-top:20px solid #0066cc;} ????/*箭头向左*/.arrow-left { ???width:0; ????height:0; ????border-top:30px solid transparent; ???border-bottom:30px solid transparent; ????border-right:30px solid yellow; } ??/*箭头向右*/.arrow-right { ???width:0; ????height:0; ????border-top:50px solid transparent; ???border-bottom: 50px solid transparent; ???border-left: 50px solid green;}
箭头朝向那个方向就不用写他的border,在反方向设置颜色 其他方向上的透明度为0

css3 小三角的用法

原文地址:https://www.cnblogs.com/gygtech/p/9926337.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved