import styled from 'styled-components';
import img from './img/bg.gif';
const Content = styled.div
;
border: 1px solid #000;
background-image: url(${img});
width: 2000px;
height: 2000px;
import styled from 'styled-components';
import img from './img/bg.gif';
const Content = styled.div
;
border: 1px solid #000;
background-image: url(${img});
width: 2000px;
height: 2000px;
For further actions, you may consider blocking this person and/or reporting abuse
Elucian Moise -
Cherlock Code 🔎 -
charudatta -
Prabhu R -
Top comments (2)
what about if do we want the img was a props of the component? can be dynamic?
you can use something like this
background-image: ${(props) =>
url(${require(
../images/${props.backgroundImage}).default})
};