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>
相关推荐
古茗前端团队7 小时前
急招!前端|测试|后端|产品(名额多,速来)
前端·后端·架构
Lsx_7 小时前
不只是 Prompt:用 Superpowers Skill 给 AI 编程装上工程化工作流
前端·ai编程·claude
小碗细面7 小时前
前端 Prompt 工程实战:如何搭建场景化 Prompt 库
前端·ai编程
阿瑞IT8 小时前
2026年 AI Agent 生产化落地全景:四大高频故障根因分析与工程解法
前端
木木剑光8 小时前
我开源了一个 React 组件库,沉淀了多个高频组件和实用 Hooks
前端·javascript·react.js
kyriewen8 小时前
DeepSeek API 高峰时段涨价 2 倍,便宜大碗的时代要结束了?
前端·ai编程·deepseek
Moment8 小时前
牛逼,NextJs 从 16.3 开始全面拥抱 Agent Native 🥰🥰🥰
前端·后端·面试
沸点小助手9 小时前
6月沸点活动获奖名单公示|本周互动话题上新🎊
前端·后端
Csvn9 小时前
React 19 `use()` 来了:以后数据加载可以不用 useEffect?
前端·react.js
没落英雄9 小时前
从零开始搭建一个 AI Agent —— LangChain + TypeScript 实战手记
前端·人工智能·架构