Asked 7 years ago
28 Oct 2017
Views 1267
angeo

angeo posted

electron js not including bootstrap.css file properly


<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

    <!-- Scripts -->
    <script>delete module.exports</script>

     <script src="./vendor/jquery-3.1.1.js"></script>
     <script src="./renderer.js"></script>

     <title>test</title>
  </head>
  <body>
    <div id="container" class="container-fluid">

      <div class="container">
        <div class="row">
          <div class="col">
            1 of 2
          </div>
          <div class="col">
            1 of 2
          </div>
        </div>
        <div class="row">
          <div class="col">
            1 of 3
          </div>
          <div class="col">
            1 of 3
          </div>
          <div class="col">
            1 of 3
          </div>
        </div>
      </div>




  </div>
  </body>


</html>



i dont know why but bootstrap is not applying .
shabi

shabi
answered Apr 25 '23 00:00

"If you're experiencing issues with properly including Bootstrap CSS in your Electron.js application, there are several things you can try. Firstly, double-check that the path to your Bootstrap CSS file is correct, as Electron.js uses Node.js for file operations. To ensure the correct path is used, consider utilizing Node's path module to programmatically generate the path.

Secondly, make sure that the < link > tag for your Bootstrap CSS file is properly formatted and includes the correct href attribute. Additionally, ensure that your Bootstrap CSS file is included before your custom CSS files in the < head > section of your HTML file. This can help avoid conflicts with custom styles.

Lastly, if you're using the < base > tag in your HTML file, verify that it is set to the correct URL to prevent any potential issues with relative URLs. By following these steps, you should be able to effectively include Bootstrap CSS in your Electron.js application."
Post Answer