简体   繁体   中英

bootstrap css is not loading in .ejs file?

I am beginner in ejs and Nodejs.I have Nodejs file.whenever localhost hits the get request.I 'm redirecting this index.ejs file.I 'm getting the data in the browser.but css not loaded what's the problem in this code.I have attached the sample code...Can anyone give me the solution.Thanks in advance...

 index.ejs <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <link ref="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css"> </head> <body> <div class="container"> <div class="jumbotron text-center"> <h1>User Authentication with Passport,Express4 and MongoDB </h1> <h3>Login or Register with...</h3> <a href="/login" class="btn btn-lg btn-success">Login</a> <a href="/register" class="btn btn-lg btn-info">Register</a> </div> </div> </body> </html>

I have used:

 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css">

It's working fine...

使用 rel="stylesheet" 而不是 ref="stylesheet"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM