에서 별도의 폴더에 그래픽을 저장하는 방법은 다음과 같은 파일 및 디렉토리 구조를 가지고 :웹 페이지
site\
site\index.html
site\background.jpg
site\CSS\
site\CSS\main.css
site\Graphics\
site\Graphics\background.jpg
* 참고 : background.jpg 두 장소에서 디스크에 있습니다.
그래픽 폴더에서 이미지가로드되지 않고 메인 (사이트) 폴더에서만 이미지가로드됩니다.
HTML :
<body>
<div id='main'>
<div id='header'>
<div id='logoCompany'>
<img class='headerGraphics' src='Graphics\logo smaller.jpg'><img class='headerGraphics' src='Graphics\Marvelous Header3 small.png'>
</div>
</div>
<div id='contentParent' class='floatClear'>
<div id='content' style = "text-align: center;">
<div id='leftPane'>
Left Col
</div>
<div id='rightPane'>
Right Col
</div>
</div>
</div>
<div id='footer'>
Footer
</div>
</div>
</body>
CSS :
* {
margin: 0px;
}
.floatClear {
clear: both;
}
.headerGraphics {
display: inline;
}
#header {
background: #023489;
text-align: center;
}
#logoCompany {
display: inline;
}
#contentParent {
height: 2200px;
width: 100%;
background-image: url(background.jpg);
}
#leftPane {
background: yellow;
float: left;
margin: 100px 0 0 10%;
opacity: .5;
width:40%;
}
#rightPane {
background: green;
float: right;
margin: 100px 10% 0 0;
opacity: .5;
width:40%;
}
#footer {
width:100%;
}
나는 시도했다 :
background-image: url(background.jpg) works.
background-image: url(..\Graphics\background.jpg) does NOT work.
background-image: url(Graphics\background.jpg) does NOT work.
사람은이 작업을 얻는 방법을 알아? 내부에 아무것도 앞에 바로 "\"를 포함, 경로에서이 W3Schools의 페이지 html_filepaths
파일 구조의 스크린 샷을 제공 할 수 있습니까? – Squeakasaur