Answer the question
In order to leave comments, you need to log in
Why doesn't the :before style work in a React component?
import React from 'react';
import "./redtext.css";
const RedT = (props) => {
let redTextStyle = {
color:"red",
postion:"relative",
display:"block",
"::before": {
position: "absolute",
content: "test",
width: "100%",
height: "20px",
backgroundColor: "red",
right: 0,
bottom: 0,
zIndex: -1,
}
}
return (
<span style={redTextStyle}
>
{props.children}
</span>
);
};
export default RedT;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question