styled-components - 第一个伪类在样式组件中不起作用
问题描述
styled.q 中的第一个伪类不起作用。它不会出现在屏幕上。如果我复制并粘贴它以便首先列出 ::before 它不起作用。如果我第二次列出第一个伪类,它会起作用。
const ResearchingRyan = styled.div`
height: 100vw;
width: 100vw;
background-image:url(${phonePic});
background-repeat: no-repeat;
background-position: left;
background-size: cover;
display:flex;
flex-direction:column;
justify-content: flex-end;
align-items: center;
@media screen and (min-width: 525px) {
background-image:url(${tabletPic});
height: 500px;
width: 500px;
}
@media screen and (min-width: 1100px) {
background-image:url(${desktopPic});
height: 500px;
width: 500px;
}
`
const QuoteP = styled.p `
background-color:${dark};
color:${bgAlt};
padding:1rem
`
const QuoteQ=styled.q`
quotes: "\201C", "\201D";
&::after {
content: close-quote;
font-weight: bold;
font-size: 36px;
color:${bgAlt};
}
&::before {
content: open-quote;
font-weight: bold;
font-size: 36px;
color:${bgAlt};
}
`;
解决方案
推荐阅读
- sql - 如何在 Toad for Oracle 中记录计划作业执行中的自定义错误
- pandas - 如何将 *multiple* 函数应用于 pandas groupby apply?
- java - 存储实时数据库快照的位置
- android - Android 权限错误(ls: /storage/emulated/: Permission denied)
- makefile - 关于makefile中包含指令的问题
- pandas - 在不规则时间进行测量时,如何插入时间序列
- c - 使用 DFS 通过 AST 递归
- laravel - 使用非唯一的路由键名?
- r - 消除 dplyr 冗余函数行
- java - Spring Boot 在 application.properties 中重命名 server.port