inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

작정하고 장고! Django로 Pinterest 따라만들기 : 바닥부터 배포까지

django 웹 개발 문의

310

cm B

작성한 질문수 2

0

background-image를 이용해 로고를 넣으려고 합니다. 그런데 이상한 경우가 계속 발생해서 문의드립니다. 파일 경로

test\static\base.css

test\static\image.png

test\media\header\image.png

test\templates\header.html

이런식으로 폴더가 구성 되어 있습니다.

header.html 파일에서 코드를 짜고, css 같은 경우 base.css에서 불러와서 사용을 하고 있습니다.

이때 base.css 파일에서

.header_logo{
  user-select: none;
  position: absolute;
  overflow: hidden;
  left: 0rem;
  top: 0rem;
  width: 14rem;
  height: 3.5rem;
  border-radius: 0rem;
  background-color: rgb(173, 123, 97);
  background-image: url("image.png");
  background-repeat: no-repeat;
  background-position: 50% 50%;
  cursor: default;
  direction: inherit;
  border: none;
}

이런 경로로 이미지 파일을 불러오면 정상 작동 합니다.

.header_logo{
  user-select: none;
  position: absolute;
  overflow: hidden;
  left: 0rem;
  top: 0rem;
  width: 14rem;
  height: 3.5rem;
  border-radius: 0rem;
  background-color: rgb(173, 123, 97);
  background-image: url("../media/header/image.png");
  background-repeat: no-repeat;
  background-position: 50% 50%;
  cursor: default;
  direction: inherit;
  border: none;
}

이렇게 이미치 파일을 불러오면 이미지가 나오지 않습니다.

 

어떤이유로 이런 현상이 생기는 걸까요?

static 폴더에 대한 설정은 되어있고, media 폴더에 대한 설정이 되어 있지 않아 이런 경우가 생길까요?

 

문의드립니다!

docker python django

답변 0

강의에 나왔던 js 파일이 깃허브에 없습니다

1

69

1

모바일 디버깅, 반응형 레이아웃 4분48초 질문

0

48

1

decorator 관련질문입니다.

0

53

1

PasswordChangeView

0

96

2

로그아웃뷰 작동 관련 (2025년 3월)

1

130

1

실행에러질문

0

149

1

@login_required 데코레이터 사용시 리다이렉트는 어디서 참조하여 설정을 하는걸까요?

0

112

1

CacheBackend 관련 에러

0

174

1

21강 CreateView를 통한 회원가입 구현 질문

0

323

1

53강 disallowedhost

0

338

2

502 Bad Gateway

0

471

0

mariadb 접근권한 오류

0

536

1

logout 후 빈 화면으로 이동합니다 ㅠㅠ

0

454

2

로그아웃 후 빈 화면으로 이동

0

325

1

서버 운영 관련 질문 드립니다.(Unable to retirve...)

0

232

1

static/base.css파일을 인식을 못합니다

0

375

1

안녕하세요 19강 디버깅 설정 질문있습니다.

0

289

1

프로필 update편 질문있습니다.

0

375

1

수업질문

0

390

1

COOP error

0

525

1

61강 Dockerfile error

0

594

1

static안에 base.css 에서 정의한 클래스가 적용되지 않습니다.

0

488

1

static 파일 중 jpg 파일만 로드 불가

0

415

1

58강 static 파일 적용 안됨

0

543

1