Answers for "how to add background image in styled components"

0

background image with styled components

const Content = styled.div`
    background-image: url(${props => props.img});
`;
<Content img={ImagePath} />
Posted by: Guest on November-27-2020
0

how to add background image in styled components

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;
`;
Posted by: Guest on June-03-2021

Code answers related to "how to add background image in styled components"

Browse Popular Code Answers by Language