-2

How do you override a BootStrap CSS file? I have created another file called site.css and linked it to the index.html file; however, this still does not allow me to override. Is this not a correct action?

2
  • Possible duplicate of Custom css overridden by Bootstrap in browser Commented Jul 28, 2016 at 3:04
  • Is it linked below the Bootstrap one? Please show that. Also show what style you want to override and how you are trying to, and the current result. Tag me... Commented Jul 28, 2016 at 3:40

2 Answers 2

0

If you want to override the bootstrap CSS so you can try this trick. put your bootstrap css and site.css in head section like below example

<link rel="stylesheet" type="text/css" href="bootstrap.css">
<link rel="stylesheet" type="text/css" href="site.css">

now site.css will be override to bootstrap.css :)

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

Comments

0

Proper way to override bootstrap is to create your own style class.

<div class="bootstrapclass yourownoverrideclass"></div>

in your css

.bootstrapclass.yourownoverrideclass {
    margin: 5px; //override content
}

Comments

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.