score:-1
use a svg as a background image:
.angle-after:after {
display: block;
content: '';
background-image: url('../../node_modules/@fortawesome/fontawesome-pro/svgs/light/angle-right.svg');
background-size: 28px 28px;
height: 28px;
width: 28px;
}
score:1
you can simply use font-awesome in css class before or after
try this code:
.class-name:before {
font-family: "font awesome 5 free";
font-weight: 400;
content: "\f1ea";
position:absolute;
color:#ccc;
top:0;
right:0;
font-size:25px;
font-weight:500;
z-index:-1;
opacity:0.5;
}
if not working please make sure are you installed fontawesome library
how install? check here >>
score:2
nothing to do with react
bold fonts, won't show up until you put in the right font-weight
issue example
.test {
font-size: 5em;
}
.test:after {
position: absolute;
font-family: 'font awesome 5 free';
content: '\f101';
}
<link href="https://use.fontawesome.com/releases/v5.7.0/css/all.css" rel="stylesheet" />
<div class="test"></div>
fix
added font-weight: 900;
.test {
font-size: 5em;
}
.test::after {
position: absolute;
font-family: 'font awesome 5 free';
content: '\f101';
font-weight: 900;
}
<link href="https://use.fontawesome.com/releases/v5.7.0/css/all.css" rel="stylesheet" />
<div class="test"></div>
Source: stackoverflow.com
Related Query
- How to get Font Awesome Icon in react app for a pseudo element in css
- How to get dual tones for font awesome in React 5
- How to get sourcemaps working for React Css Modules?
- How to get size of an element in an react app that is totally based on functional components?
- How to find Icon names for Font Awesome to import with React?
- How can I use Font Awesome icons in an Office UI Fabric React icon button component?
- How to eliminate gap between Font Awesome Icon and paragraph in React JS?
- React - how to set inline CSS for each element of map function?
- How to individually change text color and font weight in the same div element using Tailwind CSS and React
- Using font awesome icon for background image in React
- How to: randomize element positions and size within a css "grid" in a React app
- How can I get the current state of element in react for rendering progress bar?
- How to add CSS server side render for React Next app with Material-ui
- css doing nothing - referencing issue - font awesome icon - react
- How to get rid of underline for Link component of React Router?
- How to include a Font Awesome icon in React's render()
- How to get the width of a react element
- How to get "key" prop from React element (on change)?
- How to get "key" prop from React element (on change)?
- How do you center a div element in react w/out external css file
- How to adjust font size to fit view in React Native for Android?
- How do I get an attribute of an element nested in a React component using Jest and/or Enzyme?
- How to set headers for a React app created using 'create-react-app'
- How do I configure my .htaccess file for React App in Subdirectory?
- How to get code completion for typed react component properties?
- react font awesome renders big icon until scales down
- How to over-ride an @media css for a material-ui react component
- Toggling Font Awesome 5 icon with React
- how to get list of all registered synthetic event handlers/listeners for a React Component?
- How to get the react component instance corresponding to event.target element in a click handler?
More Query from same tag
- Can't theme react-toolbox navDrawer component
- React, API keys and intermediary services
- Hot reload in Electron/React application
- Where to place 'this.setState in this case?
- React: How to pass an argument to a parent component
- React: Set Weight Preference for entire site
- Handling React Checkbox States and Toggling Row Color for React Table
- I want to understand why React state is updating my array in this way
- [tag][React.js] Child showing props undefined
- React: error when integrate component without JSX
- material-ui table not displaying data
- Why is the value of "this" preserved in Higher Order Components?
- Trying to recreate linear gradient effect starting from the opposite side
- why does this error occur during fetch data from the backend
- Webpack logs on React compilation
- having multiple paths to the same component in react-router-dom v6
- How to use map function before fetch info React js
- Why does this.state.items.filter removes an item from an array
- How to unit test masked input?
- Why shouldn't children be passed as a prop?
- React webpack proxy cors issue when calling the api
- WebStorm unresolved variable warning
- Calling a seperate function from within useEffect in react
- How to save values from api as a number REACT js
- How to connect a React frontend on Netlify to a Flask backend on PythonAnywhere
- How to prevent infinite re-rendering with useEffect() in React
- spring-boot:Object as API request getting null
- React Jest - Unexpected token import
- React: if 1 state is true, change others to false
- React: how to remount a sibling component to re-run componentDidMount?