티스토리 뷰
반응형
Your problem is not actually specific to ejs.
2 things to note here
-
style.css is an external css file. So you dont need style tags inside that file. It should only contain the css.
-
In your express app, you have to mention the public directory from which you are serving the static files. Like css/js/image
it can be done by
app.use(express.static(__dirname + '/public'));
assuming you put the css files in public folder from in your app root. now you have to refer to the css files in your tamplate files, like
<link href="/css/style.css" rel="stylesheet" type="text/css">
Here i assume you have put the css file in css folder inside your public folder.
So folder structure would be
.
./app.js
./public
/css
/style.css
반응형
'웹프로그래밍 > node.js & Typescript' 카테고리의 다른 글
| 안전한 any 타입 만들기 (0) | 2020.02.11 |
|---|---|
| [node.js] require is not defined in typescript (0) | 2018.08.30 |
| [node.js] Unable to include relative path file using Jade Template (0) | 2015.06.23 |
| [node.js] socket set() get() depracated! (socket.io) (0) | 2015.06.11 |
| [node.js] How to use layout.ejs in Express 4 (0) | 2015.06.11 |
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 혜택
- 카카오뱅크
- 재테크
- etf
- 투자
- 세금
- 지도
- 부동산
- 금융
- 연말정산
- remove
- 안드로이드
- 주담대
- 대출
- 우회
- 아파트매매
- 고금리
- 2026
- 공제
- 적금
- 내집마련
- 안과
- 해외주식
- 앱테크
- 출산
- php
- 신혼부부
- ubuntu
- 카뱅
- 정부
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 | 31 |
글 보관함