📜  如何在样式化的组件中添加背景图像 - 无论代码示例

📅  最后修改于: 2022-03-11 14:55:30.140000             🧑  作者: Mango

代码示例2
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;
`;