user9240010
user9240010

Reputation:

React using external css along with bootsrap framework classes

Sorry if the heading doesn't seem accurate.

I am doing changes in my webpack to use external css in my component/container.

I am also using Bootstrap where we have inbuilt classes.

Now, I want to use external classes along with bootstrap classes on an element.

For example consider this, we are importing our external css like this

import Classes from './signup.css'

Since we are also using boostrap hence my button element would be something like this

<button type="submit" className="btn mx-auto btn-primary" onClick={this.submitHandler}>Submit</button>

By making changes in webpack, we can use CSS like this

className={Classes.something} 

now I want to use this CSS along with my bootstrap classes and since an element can't have two class name, I am kind perplexed about how to proceed.

Can someone help me?

Upvotes: 3

Views: 142

Answers (1)

T. Evans
T. Evans

Reputation: 1001

Have you tried doing something like this?

className={`class1 ${Classes.something}`}

This is also mentioned here in this stack question: Stack Overflow

Upvotes: 1

Related Questions