헤더에 배경화면을 넣어주는 css가 있다. 만약 타임리프에서 저 url을 찾고자 하면 찾을 수 없다.
header.masthead {
padding-top: 10.5rem;
padding-bottom: 6rem;
text-align: center;
color: #fff;
background-image: url("/static/images/airpodsMain.jpg");
background-repeat: no-repeat;
background-attachment: scroll;
background-position: center center;
background-size: cover;
}
타임리프가 찾을 url을 th:style속성으로 html에서 적어줄 수 있다.
<header class="masthead" th:style=" 'background-image: url(/images/airpodsMain.jpg)' ">
<div class="container">
<div class="masthead-subheading">Welcome To Angel Pods!</div>
<div class="masthead-heading lh-sm">기기를 등록하고<br>분실에 대비하세요!</div>
<a class="btn btn-primary btn-xl " href="device/add_view.jsp">등록하기</a>
</div>
</header>
참고 : https://stackoverflow.com/questions/35789526/how-to-set-background-url-for-css-files-in-thymeleaf
'성동스터디 (2021.09.09 ~ ing) > Spring' 카테고리의 다른 글
[Spring][이클립스] DevTools 동작 안할 때 (0) | 2021.12.29 |
---|---|
[Spring][이클립스] 메이븐 프로젝트 의존성이 안들어올 때 (0) | 2021.12.29 |
[Spring] @RequestBody, @ModelAttribute, BindingResult (0) | 2021.12.28 |
[Spring] 페이징 글번호 끝에서 부터 표시하기 (1) | 2021.12.24 |
[Spring] 의존성 주입과 IoC컨테이너 (0) | 2021.11.20 |
댓글