Chase Heavner
Chase Heavner

Reputation: 41

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.

Upvotes: 4

Views: 8590

Answers (2)

Shikha Dev
Shikha Dev

Reputation: 247

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 />

Upvotes: 1

Ankit Verma
Ankit Verma

Reputation: 236

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

Upvotes: 3

Related Questions