Search
 
SCRIPT & CODE EXAMPLE
 

CSS

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;
`;
Comment

background image with styled components


const Content = styled.div`
    background-image: url(${props => props.img});
`;
<Content img={ImagePath} />
Comment

PREVIOUS NEXT
Code Example
Css :: faire un fond fade to transparent css 
Css :: transition prefixes css 
Css :: two background images css 
Css :: change font with calc function 
Css :: react native flatlist styled height fit content 
Css :: restrict flex items in a row 
Css :: border around img css 
Css :: hegith specific css in media query 
Css :: mat slider custom color 
Css :: restful url to update status 
Css :: css border up and down 
Css :: putting label on top of input css 
Css :: Add dark filter to an image - CSS 
Css :: android studio cardview background transparent 
Css :: pressed button css&html 
Css :: css system default font 
Css :: sass compile minified 
Css :: break word css 
Css :: centering with flexbox 
Css :: vscode set terminal letter spacing 
Css :: css background color over image 
Css :: css flex responsive 
Css :: add css file to html 
Css :: media queries css wit logical operators 
Css :: no hover effect css 
Css :: html how to use a background image fill not stretch 
Css :: style scroll react csss 
Css :: nth last of type 
Css :: stylesheet css 
Css :: how to add background in css 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =