css - 如何通过点击 :before 内容导航到另一个页面?
问题描述
我正在尝试通过单击 :before 此卡的内容导航到另一个页面,但它不起作用
jsx:
<div className="inner-container-one">
<Link to="/programDetails">
<img src={psycho} alt="" />
</Link>
</div>
scss:
.inner-container-one {
position: relative;
&:before {
content: "weight training ➔";
vertical-align: middle;
position: absolute;
background: orange;
z-index: 999;
cursor: pointer;
}
}
有没有办法让我可以通过点击 :before 伪元素导航到另一个页面?
解决方案
推荐阅读
- javascript - 我的 Get Ajax 请求中的跨域读取阻塞 (CORB) 问题
- xcode - 约束和自动布局在 Storyboard 中是如何工作的?Xcode 9
- java - BeanCreationException:创建类路径资源中定义的名称为“pgService”的 bean 时出错
- vba - 仅 Mac 上的 FileDialog 运行时 91 错误
- android - Android ViewModel 设计/架构
- android - 如果内容的高度大于屏幕,CardView 中的 ListView 不显示所有内容
- angular - 如何动态管理角度布局
- php - 拉拉维尔 5.6。无法在构造函数中获取错误消息
- node.js - 如何在 Nodejs 中执行主动睡眠/超时?
- asp.net-mvc - 现有 aspnet 核心 MVC 项目的轻量级博客引擎