2

I have an react component, with two buttons:

import React from 'react'
import './BuildControl.css'
import { Button } from 'react-bootstrap';


const buildControl = (props) => (
    <div className="BuildControl">
           <div className="Label"> {props.label}</div>
            <Button bsStyle="warning" >Less</Button>
            <Button bsStyle="custom">More</Button>
    </div>
);

export default buildControl;

I used the warning button, for the one class, and custom for the other.

Then I added some styling for my custom button

.btn-custom {
background-color: #99703F;
color: white;
}

.btn-custom:hover {
    background-color:  rgba(100, 63, 15, 0.637);
    color: white;
}
.btn-custom:active{
    background-color:  rgba(61, 37, 6, 0.637);
    color: white;
    border: 1.5px solid rgb(228, 206, 204);
}

this works fine, but now my problem is that I want to add the border to the button with the bsStyle="warning" as well, how can I do this?

I know I could just make a style component inside my component and add that, but I don't think it would be a best practice, since I'm already importing CSS from an external file, on the other button? How can I solve this the best way possible

2 Answers 2

1

Create one more className and add it next to ur current className ,

.cstm-border {
  border: red !important;
}

//dont forgot to add important to that

and then add it next to ur className ,

<Button bsStyle="warning cstm-border" >Less</Button>

Sign up to request clarification or add additional context in comments.

Comments

0

if you made the your app by "create-react-app", you can find the "public" directory.

into the public directory have the index.html

you can add the bootstrap link on the "index.html"

2 Comments

Thank you for your answer. I have done this, but it does, unfortunately, does not solve the problem, since all HTML is rendered inside react.
Aww that's great haha. if my answer helpful to you, vote me please~!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.