how to override bootstrap css code example

Example 1: bootstrap override css

<!---------------- How do I override Bootstrap CSS? ------------------->

If your custom styles are not overriding the bootstrap styles, all you 
need to do is move the link to your custom stylesheet to a line after 
the bootstrap link:

<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="styles.css">

This means that you first load the default bootstrap styles, then you 
can override some of those components with your own custom CSS.

Example 2: bootstrap can i override css locally

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="custom.css">
    <title>Hello, world!</title>
  </head>
  <body>
    <h1>Hello, world!</h1>
  </body>
</html>

Example 3: css can't override bootstrap

1) Add the link to css after link to bootstrap
2) or, use inline css

Tags:

Css Example