css 手写返回箭头

因为在开发App时,为了自定义返回栏,返回箭头,一般都用图片,当图片不方便,最好用css样式实现。

逻辑:

画出一个正方形,让它旋转45度,只显示你需要的两个边即可

代码

html 复制代码
<!DOCTYPE html>
<html lang="en">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport"
        content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no,initial-scale=1">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-status-bar-style" content="white">
    <meta name="apple-mobile-web-app-capable" content="no">
    <title>Css arrow</title>
</head>
<style type="text/css">
    #triangle-facing-right {
        display: inline-block;
        margin: 72px;
        border-right: 24px solid;
        border-bottom: 24px solid;
        width: 120px;
        height: 120px;
        transform: rotate(-45deg);
    }

    #triangle-facing-left {
        display: inline-block;
        margin: 72px;
        border-left: 24px solid;
        border-bottom: 24px solid;
        width: 120px;
        height: 120px;
        transform: rotate(45deg);
    }
</style>

<body>
    <div id="triangle-facing-right"></div>
    <div id="triangle-facing-left"></div>
</body>



</html>
相关推荐
狂炫冰美式3 小时前
人均配了AI, 为什么公司还是没变快? 🤔 本质还是分布式系统问题
前端·后端·架构
乘风gg4 小时前
多 Agent 不是万能的!搞懂这 5 个原则,少走 1 年弯路!
前端·agent·ai编程
猩猩程序员4 小时前
Vercel 推出 Agent 框架 Eve:让 AI Agent 像写 Web 应用一样简单
前端
爱读源码的大都督5 小时前
Claude Code源码分析(三):为什么系统提示词中需要有tools呢?
前端·人工智能·后端
爱勇宝5 小时前
Claude Code 被曝暗藏“隐形检测”代码:封代理不是最可怕的,可怕的是你根本不知道它在干什么
前端·后端·程序员
小牛不牛的程序员5 小时前
我用 Claude Code 半天撸完了一个完整网站,AI 编程到底提升了多少效率?
前端
东风破_5 小时前
JavaScript 面试常考的字符串算法:从反转字符串到回文判断
前端·javascript
ITOM运维行者5 小时前
从零搭建企业级服务器监控体系:踩坑实录与架构设计
前端·后端
monologues5 小时前
深入 Vue 3 源码:响应式系统的精妙设计与编译优化
前端
hunterandroid5 小时前
Paging 3 分页:从手动分页到声明式加载
前端