Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Responsive background image in React

I have a React component that is being used as a home page for a site that I am building.

I am using react-bootstrap and I need to know how to create a responsive background image for this home page using React.

like image 606
Chase Heavner Avatar asked Mar 04 '23 03:03

Chase Heavner


2 Answers

For responsive image given style={{height:'auto',width:'100%'}}

like image 175
Ankit Verma Avatar answered Mar 11 '23 03:03

Ankit Verma


Use this ..It's really work..

  1. Add this library

import Image from 'react-bootstrap/Image';

2.Import image though..

import <Image Name> from ' <Image path>';

3.for import image..

<Image src={<Image Name>} fluid />

like image 22
Shikha Dev Avatar answered Mar 11 '23 03:03

Shikha Dev