what is the proper way to get bootstrap 4 to work

nadavgam

I'm trying to get it go with Bootstrap 4. All the dependencies I downloaded through Bower.

Here is my index.html

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <link rel="stylesheet" href="bower_components/bootstrap/scss/bootstrap.scss">

</head>
<!-- apply our angular app to our site -->
<body ng-app="routerApp">

<!-- NAVIGATION -->
 <!-- <nav class="navbar navbar-dark bg-dark " >
    <div class="navbar-header">
      <a class="navbar-brand" ui-sref="#">AngularUI Router</a>
    </div>
    <ul class="nav navbar-nav">
      <li><a ui-sref="home">Home</a></li>
      <li><a ui-sref="about">About</a></li>
    </ul>
  </nav>-->

<nav class="nav">
  <a class="nav-link active" href="#">Active</a>
  <a class="nav-link" href="#">Link</a>
  <a class="nav-link" href="#">Link</a>
  <a class="nav-link disabled" href="#">Disabled</a>
</nav>

  <!-- MAIN CONTENT -->
  <!--<div class="container">

    &lt;!&ndash; THIS IS WHERE WE WILL INJECT OUR CONTENT ============================== &ndash;&gt;
    <div ui-view></div>

  </div>-->

<button type="button" class="btn btn-success">Primary</button>


  <script src="bower_components/jquery/dist/jquery.js"></script>
  <script src="bower_components/popper.js/dist/popper.js"></script>
  <script src="bower_components/bootstrap/dist/js/bootstrap.js"></script>

  <script src="bower_components/angular/angular.js"></script>
  <script src="bower_components/angular-ui-router/release/angular-ui-router.js"></script>
 <script src="app.js"></script>

</body>
</html>

I tried both syntaxes of Bootstrap 4 and Bootstrap 4.1 and nothing is working. I tried buttons/navs/dropdown nothing is working. What am I missing?

Dirk J. Faber

In your <head> you have <link rel="stylesheet" href="bower_components/bootstrap/scss/bootstrap.scss"> which will not work because you are referring to a .scss-file, which is a pre-processor for css that compiles your css on the server side and outputs .css for the browser. So you either need to compile the file to css or simple use the .css file in your <head> tag. For example:

<link rel="stylesheet" href="bower_components/bootstrap/css/bootstrap.css">

If you cannot get this working you can always use a CDN like so:

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

In React/Bootstrap 4, what is the proper way to disable a button to prevent duplicate form submission?

What would a proper way to go, to get the "Copy & Swap Idiom" to work here?

What is the proper way to detect Bootstrap dropdown menu selections?

What is the proper way to instrument classes loaded by bootstrap / extension class loader?

What is a proper way to align content using Bootstrap Grid?

What is the proper way to use the Months view in Bootstrap Datepicker?

Proper way to deal with HtmlUnit warnings about invalid CSS in Bootstrap 4?

MySQL NodeJs - Proper way to get rows.each to work

What is the proper way to configure SMTPAppender in log4j?

What is the proper way to get data from database in react?

Shopware 6: What is the proper way to get an entity repository?

What is proper way to get ip address from NWConnection

What is the proper way to get background-image in php for css?

What is the proper way to wait for connections?

What is the proper way to implement CupertinoActionSheet?

What is the proper way to use inotify?

What is the proper way to do this in Rust?

What is the proper way to use continue?

What is the proper way for terminating tasks?

What is the proper way to use if _ is _ or .isKind(of: )

What is the proper way to use IF THEN in AQL?

What is the proper way to test types?

Bootstrap3: what is the proper way to change navbar-collapse div to fullscreen menu?

What is the proper way to include bootstrap in my application.css.scss file?

Proper way to get the windows UserName

iOS9 What is the proper way to update AFNetworking calls to work with HTTPS (error -1200 , -9824)?

What is the proper way to handle concatenation of data returned from multiple http observables in angular2/4 rxjs?

What’s the proper way to handle an AJAX call behind Symfony 4 firewall?

What is the proper way of registering new user using IdentityServer4 with multiple clients?