0

I setapp.use(express.static(path.join(__dirname, 'public'))); in my app.js

and now I use bootstrap.css and myself css file main.css

index.html:

  ┊ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  ┊ <link rel='stylesheet' type="text/css" href='bootstrap/theme/bootstrap.united.css' />
  ┊ <link rel='stylesheet' type="text/css" href='bootstrap/css/main.css' />

main.css:

  1 body {
  2   background-color: red;
  3 }

and my file's tree is:

public
├── bootstrap
│   ├── css
│   │   ├── bootstrap.css
│   │   └── bootstrap.min.css
│   ├── js
│   │   ├── bootstrap.js
│   │   └── bootstrap.min.js
│   └── theme
│       └── bootstrap.united.css
├── css
│   └── main.css
└── jQuery
    └── jquery-1.12.0.min.js

my node server is 127.0.0.1:3000

in my chrome, the bootstrap.united.css can work,
but main.css can not work,
and I can load it in http://10.0.8.88:3000/css/main.css

why main.css has been loaded, but doesn't work?

1 Answer 1

3

It looks like in your href of your main.css link, you started the file path with 'bootstrap' but the css folder begins outside of that branch.

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

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.