css background-image 오류
본문
<css>
.visual{background-image: url('/img/visual.PNG') no-repeat center; background-size: cover; height: 700px; width: 100%;}
.visual .inner{width: 1200px; margin: 0 auto}
<html>
<div class="visual">
<div class="inner">
</div>
</div>
img 폴더에 이미지 들어가 있는거 확인했고, css랑 연결하는 상위링크 확인했고, 다 확인했는데 이미지가 안뜨네요 왜이런걸까요
답변 3
수정 전
background-image
수정 후
background
더 자세한 건, 아래 참고해 보세요.
https://codepen.io/sinbi/pen/MWbLEVq
.visual{
background-image: url('/img/visual.PNG');
position:absolute;
top:0;
left:0;
width:100%;
height:700px;
display:flex;
justify-content:center;
align-items:center;
background-attachment:fixed;
background-size:cover;
background-position:50%;
opacity: .1;
z-index:-1;
}
'/img/visual.PNG'는 최상위 디렉토리 /img에 "visual.PNG" 파일이 있어야합니다.
!-->이거 질문한 사람입니다:)
이게 braket에서는 정상작동하는데 visual studio code에서는 아예 안되네요,,,,
왜그런지는 아직도 모르겠지만 일단 이렇게 해결되었습니다
답변을 작성하시기 전에 로그인 해주세요.