티스토리 뷰
트러블 슈팅 🥤
Refused to apply style from 'http://localhost:8080/css/main.css' because...
DJDU 2023. 5. 9. 22:59프로젝트 중 팀원으로부터 한 피드백을 받았다.
장바구니 페이지 이동 시, 크롬 개발자도구 '콘솔' 창에 에러메시지가 발생한다는 제보였다.

Refused to apply style from '<http://localhost:8080/css/main.css>'
because its MIME type ('text/html') is not a supported stylesheet MIME type,
and strict MIME checking is enabled.
문제 🎨
위와 같은 에러가 발생하는 이유는 경로를 잘못 적어주었기 때문이다.
해석하면, 'main.css'라는 스타일시트 파일을 적용할 수 없다는 뜻이다.
<head>
<%@ include file="/WEB-INF/views/include/header.jsp" %>
<link rel="stylesheet" href="/css/main.css"/>
<link rel="stylesheet" href="/css/order/cart.css"/>
<script src = "/js/order/format.js"></script>
<title>장보고 | 장바구니</title>
</head>
해결방안 🕵️♂️
경로를 수정한다.
<head>
<%@ include file="/WEB-INF/views/include/header.jsp" %>
<link rel="stylesheet" href="/css/index.css"/>
<link rel="stylesheet" href="/css/order/cart.css"/>
<script src = "/js/order/format.js"></script>
<title>장보고 | 장바구니</title>
</head>

레퍼런스 📎
'트러블 슈팅 🥤' 카테고리의 다른 글
| [Tomcat] 톰캣 서버 실행 오류 - Specified class is an interface (1) | 2023.05.09 |
|---|---|
| [공유] [IntelliJ] 인텔리제이 콘솔 한글 출력 깨짐 (0) | 2022.10.31 |
| 🕵️♂️ '컴퓨터가 클래스를 못 찾는다' 시리즈 (0) | 2022.10.25 |
| [에러 창고] Error: Could not find or load main class com.fastcampus.ch2.YoilTeller (0) | 2022.10.18 |
| 에러 모음집 (0) | 2019.12.31 |
댓글
공지사항
